-
-
Notifications
You must be signed in to change notification settings - Fork 1k
refactor(history): use TSR_key
namespace in state for hash
#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
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! 🙏 |
TSR_key
namespace in state for hash
View your CI Pipeline Execution ↗ for commit 5962a34.
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-with-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
This comment was marked as resolved.
This comment was marked as resolved.
I've updated the description and added the removal into the v2 checklist. @naoya7076 thank you for taking this up and working with us on this one! |
Updated description by @SeanCassiere
The scope of this pull request has changed to the following:
__TSR_key
intolocation.state
.__TSR_key
mirrors the existing functionality oflocation.state.key
.location.state.key
to favorlocation.state.__TSR_key
.location.state.__TSR_key
.Original 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.