Skip to content
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

fix: useQueryStates does not update values correctly when config changes #908

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

maslianok
Copy link
Contributor

@maslianok maslianok commented Feb 12, 2025

Fixes #907

Copy link

vercel bot commented Feb 12, 2025

@maslianok is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 6:34pm

Copy link
Member

@franky47 franky47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the repro and the test!

The fix can be made simpler in useQueryStates.ts, if we get into the block where we detected the keys changed (lines 114-135), we can safely disregard the hasChanged flag and reset the state.

@franky47 franky47 enabled auto-merge (squash) February 12, 2025 18:32
@franky47 franky47 merged commit bf56cb7 into 47ng:next Feb 12, 2025
23 checks passed
Copy link

🎉 This PR is included in version 2.4.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@franky47 franky47 removed this from the 🚀 Shipping next milestone Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"useQueryStates" does not update values correctly when config changes
2 participants