Sorry for going against all codes of conducts and the absolutely terrible bug report. I'm already overdue on a solid-start project and therefore don't have time to report all the bugs properly but I think I have an easy fix for this one and it's quite an obvious mistake, hear me out.
On the following line, reading location.pathname and location.hash is reactive, since location is a store. Therefore when using setSearchParams inside of an effect it will re-execute when the location changes, leading to unexpected behavior. I think that expression (and all accesses to properties of location) in that function should be wrapped in untrack to prevent this.
https://github.com/solidjs/solid-router/blob/d0695a715912db2480e082d03e5f0533a8b87e2d/src/routing.ts#LL108C36-L108C36
Or is it intended behavior that effects that call setSearchParams re-execute when the location changes?
Sorry for going against all codes of conducts and the absolutely terrible bug report. I'm already overdue on a solid-start project and therefore don't have time to report all the bugs properly but I think I have an easy fix for this one and it's quite an obvious mistake, hear me out.
On the following line, reading
location.pathname
andlocation.hash
is reactive, sincelocation
is a store. Therefore when using setSearchParams inside of an effect it will re-execute when the location changes, leading to unexpected behavior. I think that expression (and all accesses to properties oflocation
) in that function should be wrapped inuntrack
to prevent this. https://github.com/solidjs/solid-router/blob/d0695a715912db2480e082d03e5f0533a8b87e2d/src/routing.ts#LL108C36-L108C36Or is it intended behavior that effects that call
setSearchParams
re-execute when the location changes?