Reactive Route Search Query Composable
Does somebody have deeper experience with this?
I am trying to implement a composable to reactively use a route search query. Meaning that the value updates reactively whenever the route query parameter changes. And when setting a new value with
However, there are issues with SSR, which makes it hard to implement this. This is how I got so far:
Works in most cases, but in the case where I do a
I am trying to implement a composable to reactively use a route search query. Meaning that the value updates reactively whenever the route query parameter changes. And when setting a new value with
.value, it does a navigateTo() in the background.However, there are issues with SSR, which makes it hard to implement this. This is how I got so far:
Works in most cases, but in the case where I do a
navigateTo() in any component (or the user is navigating back & forth) where certain query parameters are getting removed (e.g. from ?foo=bar&xyz=abc to ?foo=bar), it's still not reactive (watching the searchQuery value reacts to changes in the query parameters, not not when it gets removed e.g. from the user navigating back & forth).