Skip to content

Passing states between routes #1186

Answered by SeanCassiere
yahelcohen01 asked this question in Q&A
Discussion options

You must be logged in to vote

Edit: This discussion here details the process of passing state between routes.

🚧 The content below, can now be considered to be outdated, but the discussion matter may be useful for understanding why this state field is only validated at the type-level and not at runtime.

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.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@yahelcohen01
Comment options

@IanVS
Comment options

@SeanCassiere
Comment options

@nyngwang
Comment options

Answer selected by yahelcohen01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants