-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: update state key references from 'key' to '__TSR_key' #4356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naoya7076 thanks for opening a PR for this, but we can't ship this in within the 1.0 release-cycle since this'd be considered a breaking change.
Since we have user-facing functions (like getScrollRestorationKey
) which rely on location.state.key
being defined/accessible.
I'll add this to the v2 list for it to be renamed to __TSR_key
.
Edit: I've added this to the v2 list.
@SeanCassiere Thank you again for your feedback. I've changed |
@naoya7076 we currently do not have a v2 development branch open. As I mentioned earlier, I have added it onto the v2 list so that it gets done for its development. The only path forward here, in having this merged into |
@SeanCassiere Thank you for the guidance! I've updated the implementation as requested:
Thanks for the clear direction! 🙏 |
Description
Currently, when using TanStack Router, if users define a property named
key
within the navigation state, its value is overridden by the router's internal logic, which assigns a random key.For example:
#284 (comment)
Expected Behavior
When explicitly providing a
key
within the navigation state, it should preserve the user's defined value rather than being overridden by the router's internal random key.