Skip to content
Discussion options

You must be logged in to vote

The concept of params relates to path parameters. For example, in this path /posts/$postId, the param is the $postId. As such, by default, all the path parameters are string.
So this navigation would look like:

navigate({ to: '/posts/$postId', params: { postId: '123' } });

What you are looking for might be similar to the browser native window.history.pushState.
Tanstack Router does allow you to pass data between routes during navigation using the state field.

🚧 Tanstack Router currently does not provide any type-safety at runtime for this because of the challenges in data serialization for this magic field.

If you want to use it, you'll need to register the types for this HistoryState u…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@SalahAdDin
Comment options

@xsjcTony
Comment options

@SeanCassiere
Comment options

@Zen-cronic
Comment options

@acidoxee
Comment options

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