Open kanasva opened 1 week ago
Thanks for the report, it sounds like this is a side-effect of the optimistic useSearchParams update we did in #718.
The order of renders looks like the following:
One vector of optimisation would be to set the optimistic search params in the same tick as the internal state update, I'll see what I can do about that.
As an aside regarding computationally expensive operations that block the main thread, you might want to consider plugging them onto a deferred value to avoid race conditions, see #722.
Context
What's your version of
nuqs
?What framework are you using?
Description
Setting query state causes that component to rerender for 4 times both in development and production on my local machine. However, in nuqs version 2.0.4, it rerenders 2 times.
Reproduction
Example: Steps to reproduce the behavior: