Impossible to navigate to route that have any component using setSearchParams in createEffect

Hi, I know this seems not to be the right way to handle state, but could anyone take a look? https://stackblitz.com/edit/solidjs-templates-v8bqor?file=src%2Froutes%2Fother.tsx
4 Replies
Madaxen86
Madaxen866mo ago
In this case, you don’t need a signal. You can use setSearchParams in the onInput . It is basically a reactive store which persists its data in the url. If you use the value e.g. to fetch data, it might make sense to use some kind of debounced value or use just set the value when a button is pressed.
TaQuanMinhLong
TaQuanMinhLongOP6mo ago
Thanks for the reply, I'm just wondering why it blocks on navigate I'm in the case that I have a component which needs to conditionally use searchParams to store state or using a normal signal Like a switching mode one Any suggestions for this?
Madaxen86
Madaxen866mo ago
Inside your event handler condition ? setSignal(…) : setSearchParams(…) ?
TaQuanMinhLong
TaQuanMinhLongOP6mo ago
OK, i'll give it a try, thanks

Did you find this page helpful?