-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
useQueryState with push mode is not updated after browser back #418
Comments
Yes have the It seems the same issue happen on this demo Builder pattern. But in this playground |
More generally with useQueryState, any kind of shallow routing won't work with 14.0.3 but also won't work with 14.0.2
I have updated the CodeSandbox to illustrate shallow routing well updated searchParams while it won't with useQueryState.
|
I have the same issue, how can I fix it? |
If using the app router: try using If using the pages router, unfortunately the issue has been here for a while, and is being tracked in #419. I'm having a hard time making it work with all combinations of basePath and dynamic routes. |
I updated from "next": "^14.0.3" to "next": "^14.0.4-canary.37" and it fixes the issue. |
I merged #419 which includes a fix for For the app router, updating Next.js to 14.0.4 is required to get the shallow routing fix (which impacts push). |
Yep good job, I confirm push is well sync now |
Thanks for your feedback @gkielwasser, 1.13.2 has been released. |
Context
What's your version of
next-usequerystate
?1.13.0
Next version: 14.0.3
Are you using:
Description
I'm using useQueryState with the history push mode. I would expect using browser back button would update query state. It seems back is not taken in account and therefore the state is not updated.
Reproduction
CodeSandbox
I'm not sure it can be well reproduced in CodeSandbox.
Example: Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: