T
TanStack4y ago
rival-black

Location internal state

In react-router-dom, I've used a pattern when handling authenticated pages which allows me to redirect to a login page, and then back to the original page attempting to be accessed, using the location state. From reading the tanstack code, it seems not to have the same kind of internal state. Is the expectation that I should store this kind of state in React context, or somewhere else, vs in the location?
2 Replies
foreign-sapphire
foreign-sapphire4y ago
This is really just a lack of state implementation on my end. We use the same history package react router does, so we can support it. Just need to add it. Hang on Alright, the next release will support the state option You can even add types to it by declaration merging on the LocationState interface exported by TanStack Router
rival-black
rival-blackOP4y ago
Awesome, thanks!

Did you find this page helpful?