Passing states between routes #1186
-
I have a state that I want to use its setState in two diffrent routes. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Edit: This discussion here details the process of passing state between routes.
If you want to pass state between Routes, the search params or query params are your go to option. If you want your data to be passed outside of the Router you have the built-in React-context pathway or third-party solutions like Jotai and Zustand. What is this data you need to pass between routes? Often times I've found that search-params are the best solution. |
Beta Was this translation helpful? Give feedback.
Edit: This discussion here details the process of passing state between routes.
If you want to pass state between Routes, the search params or query params are your go to option.
If you want your data to be passed outside of the Router you have the built-in React-context pathway or third-party solutions like Jotai and Zustand.
What is this data you need to pass between routes? Often times I've found that search-params are the best solution.