-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Demo with dynamic routing ? #282
Comments
Thanks for the report, that's a bug indeed. It looks like we're missing the Ideally, we should only touch the querystring (the Would you like to open a PR? |
🎉 This issue has been resolved in version 1.6.1-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've published a fix attempt in The drawback is that now the state updater function will be recreated when |
Hi! Thanks for the quick reply and patch! |
Hum this fix had a side-effect of no longer allowing to clear the query by setting the state to Also my initial assumption was flawed: Edit: no longer using |
🎉 This issue has been resolved in version 1.7.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closing as I've got E2E tests that cover this case now. Let me know if you still encounter some issues! |
Reopening as I'm now encountering this issue (but not in E2E tests, maybe not all cases are covered). We could theoretically use |
Do we have any updates on this issue? Ran into the same problem as above today when using the hook inside a dynamic route using the pages directory. |
@SimonProper what version of Next.js and next-usequerystate are you using? Are you able to update to 1.8+ (it requires Next.js 13.4+)? The implementation has changed a lot since this issue was (re)opened, and tests with dynamic routes in the pages router seem promising (there is no longer need for the asPath when using |
@franky47 I did indeed have the wrong version of next, however the problem seems to persists even after updating to next v.14.0.1 and next-usequerystate 1.10.0. I will see if I can make a minimal reproduction example |
@franky47 So I managed to reproduce the issue. It is occurring when you are setting a value with the option Have a look at the codesanbox bellow.
https://codesandbox.io/p/sandbox/next-usequerystate-dynamic-page-issue-79zgvw |
* fix: Non-shallow updates on dynamic pages Closes #282. * chore: Fix undefined when running test locally * chore: Fix Turbo dependency on basePath * fix: Handle base path
🎉 This issue has been resolved in version 1.10.2-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@SimonProper could you try |
@franky47 I can confirm that it works with your latest changes in |
🎉 This issue has been resolved in version 1.10.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello,
I'm currently having an issue with useQueryState when used in complement of a dynamic routing. I might be missing something but couldn't find information in the doc :x
I've got something like : 'pages/product/[slug]/[[...params]]' and I'd like to keep some detail about my product in the URL (variant, size...) but as soon as I set a value I get this error :
I use the version 1.6.0 of next-useQueryState.
Any ideas?
Thanks,
Bobu
The text was updated successfully, but these errors were encountered: