T
TanStack5mo ago
rotten-yellow

How to Clear Multiple Routes from Navigation History in TanStack Router

Navigation Flow: - Start at /account/networks - navigate({ to: "/account/networks/search" }) - navigate({ to: "/account/networks/search/join-dialog" }) - After success action, we want to return to /account/networks The Issue: When using replace: true to navigate back to /account/networks: - Navigation to /account/networks works - But then router.history.back() at /account/networks takes user to /account/networks/search - We want it to go back to /account - We need to clear both the search and join-dialog routes from history
navigate({ to: "/account/networks", replace: true });
navigate({ to: "/account/networks", replace: true });
Is there a way to clear multiple routes ( both the search and join-dialog routes) from the history stack in TanStack Router?Navigation Flow:
1 Reply
extended-salmon
extended-salmon2w ago
did you ever figure out a solution for this? Dealing with a similar problem

Did you find this page helpful?