Closed hallucinogenizer closed 1 week ago
Thanks for this great report!
I can reproduce the error and I think I see where it's coming from, I'll have a fix out shortly.
Could you try this and let me know if it solves the problem on your end?
pnpm add https://pkg.pr.new/nuqs@759
Yup, this fixes the problem in my codebase as well. Thanks!
:tada: This issue has been resolved in version 2.1.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Context
What's your version of
nuqs
?What framework are you using?
Which version of your framework are you using?
v14.2.0
Description
If you use the
urlKeys
option along withhistory: "push"
, then on pressing the browser back button, the query params get removed from the URL but the state variable returned byuseQueryStates
still shows the old value.This issue does not occur if you remove
urlKeys
.Reproduction
https://codesandbox.io/p/devbox/tender-paper-8sd759
Example: Steps to reproduce the behavior:
/working
route to see the correct behvaior. The steps to perform are written there. This page does not useurlKeys
hence it works well./not-working
route to see the incorrect behavior that happens when you addurlKeys
. The steps to perform are mentioned there.