pass a “state” when using “navigate()”
Hey,
Thanks for all the help with the previous question. Now to the next one:
After sign up I’m redirecting user to “sign in” page using “navigate({to: “/sign-in”})”. I want to display some kind of toaster for users that just signed up and are on sign in page to inform them to check the email.
I would like to pass some kind of “state” param when doing “navigate(…)” and the read this state on the sign-in page.
I would like to not do this using search params but rather to keep it hidden to the end user.
Thanks for all your help!
4 Replies
continuing-cyan•13mo ago
you could use a search param but hide it using route masking
continuing-cyanOP•13mo ago
Just found out about that and it's 100% my case
rival-black•13mo ago
Couldn't you use the actual
state
param?continuing-cyanOP•13mo ago
By writing
state
param I meant something like in react-router-dom
:
^ this could be accessed later by react-router-dom
's useLocation
hook.
I was not able to do the same in tanstack-router