Filtered Memory History in Tanstack Router
Heylo, I have a component in my app that renders through a modal which is intended to be a mini-version of the app controlled through memory history. I've achieved this using two RouterProviders using the same route tree.
I'd like to implement a behaviour where if I navigate out of specific routes, it will lead me to a
ContinueOutside
component, which will have a link to navigate me out (thereby taking me out of the memory history'd router)
I've got a very crude implementation as follows and would like to know if there was a better and typesafe way to do this in Tanstack Router.
If I could also render ContinueOutside
within the router provider it would also be a plus.
1 Reply
frozen-sapphireOP•3w ago
I'm thinking the best way to do this is to remove all the routes that are not in allowedRoutes, then make them go into
ContinueOutside
as a not found component, but I'm not sure how to do that
Alternatively, I can also define another route tree with code based routing. That's always an option