Query State issues
Error: "Maximum update depth exceeded" when clicking the Select dropdown in TanStack Router. Works fine in React Router using nuqs. How to properly update search params without infinite re-renders?
3 Replies
conventional-tan•3mo ago
can you turn this into a complete example please, e.g. by forking one of the existing router examples on stackblitz?
useful-bronze•3mo ago
If it's the
Select
from shadcn / radix, I think it calls onValueChange
on mount. I'm not entirely sure, but that might be your issue.
If that's correct, then you might consider using the functional version of the search
param in navigate
to avoid re-creating your updateFilters
function on every render:
And then wrap your MyTable
in memo
quickest-silverOP•3mo ago
ah that must be why i couldn't reproduce this issue using the html select on stackblitz... let me try that