Expected component re-render behaviour on search params change
Hey everyone, I’ve got a question about navigation and component re-renders in TanStack Start.
In one of my routes I have three components:
1. A button that adds a search param (e.g. page=2) using
2. A component that displays the current page search param. I get the value by using
3. A component that doesn’t use any route hooks (just a plain component)
When I click the button to update the search param, the whole app re-renders including the component no 3.
Is this expected?
My understanding is that only components that read search params using useSearch should re-render, not the entire app. Am I missing something?
Thanks in advance!
In one of my routes I have three components:
1. A button that adds a search param (e.g. page=2) using
navigation function returned by useNavigate hook2. A component that displays the current page search param. I get the value by using
useSearch hook.3. A component that doesn’t use any route hooks (just a plain component)
When I click the button to update the search param, the whole app re-renders including the component no 3.
Is this expected?
My understanding is that only components that read search params using useSearch should re-render, not the entire app. Am I missing something?
Thanks in advance!