You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if TanStack Router / Start supported a built-in mechanism for persisting search params per route so that when a user navigates away from a route and then returns via app navigation, the last search state for that route is restored automatically.
Currently:
Let's say I store my Orders search param like /orders?query=123
If I navigate “programmatically” using <Link to="/products" /> (without search) and then later go back to /orders, the search params (?query=123) won’t be restored unless every navigation manually includes them.
Example:
/orders?query=123
→ click link to /products
→ click link to /orders ← now search params are gone
Desired Behavior
It would be nice to have optional per-route persistence (e.g., route-level config, middleware, or a router option) so that return navigation re-applies the last set of search params for that route:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
It would be great if TanStack Router / Start supported a built-in mechanism for persisting search params per route so that when a user navigates away from a route and then returns via app navigation, the last search state for that route is restored automatically.
Currently:
/orders?query=123<Link to="/products" />(without search) and then later go back to/orders, the search params (?query=123) won’t be restored unless every navigation manually includes them.Example:
Desired Behavior
It would be nice to have optional per-route persistence (e.g., route-level config, middleware, or a router option) so that return navigation re-applies the last set of search params for that route:
Thanks for any thoughts or help on this!
Beta Was this translation helpful? Give feedback.
All reactions