-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Keys with special characters are not encoded, reading encoded keys result in incorrect state after sync operation #599
Comments
Thanks for the report. It looks like the key should be encoded in the same way as the value here: I'll run some tests and come back to you. |
I have published a fix in #600 via a snapshot release, could you give it a try and let me know if it solves your problem?
|
Awsome. Works! Thanks for super quick response 💚 |
* fix: Encode special characters in keys Closes #599. * test: Start with less encoding to verify first parsing
🎉 This issue has been resolved in version 1.17.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
What's your version of
nuqs
?Next.js information (obtained by running
next info
):Are you using:
basePath
option in your Next.js configwindowHistorySupport
flag in your Next.js configDescription
Having a special character (&) in key, causes url read issues.
Reproduction
When using following keyMap the keys in the URL are not encoded resulting in incorrect read/sync
When using following keyMap with encoded keys, the URL is correctly encoded, but after sync operation 'useQueryStates' returns
traits as
{ 'Duration%20%26%20Location': null }
. Using a debugger I saw that the query state object was{ 'Duration+%26+Location': null }
I have also tried to use following keyMap but with the same result
The text was updated successfully, but these errors were encountered: