Demo with dynamic routing ?
See original GitHub issueIssue Description
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 :
Unhandled Runtime Error Error: The provided
href
(/product/[slug]/[[…params]]?variant=od) value is missing query values (slug, params) to be interpolated properly. Read more: https://nextjs.org/docs/messages/href-interpolation-failed
I use the version 1.6.0 of next-useQueryState.
Any ideas?
Thanks, Bobu
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Dynamic Routes Demo - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >Dynamic Routing Demo - Vonage
In this demo, you'll learn how: The CRM can be leveraged for routing decisions; To build a call plan to improve first call...
Read more >Dynamic Routes Details - Next.js
Sanity Example (Demo). That's it! In the next lesson, we'll talk about API Routes in Next.js. Quick Review: You ...
Read more >Dynamic Routing in Next.js - Hygraph
Next.js supports dynamic routing, which helps us achieve this use ... For demo purposes, we have populated the data in this file itself....
Read more >Dynamic Routing Protocols - Catchpoint Systems
Dynamic routing protocols, as their name suggests, are used to dynamically exchange routing information between routers. Their implementation allows network ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Reopening as I’m now encountering this issue (but not in E2E tests, maybe not all cases are covered).
We could theoretically use
window.location.pathname
as a replacement for theasPath
here, if we assume that the query updater function should only work on the query string (ie: that the pathname remains the same before and after setState).Hi! Thanks for the quick reply and patch! Looks good to me, no more errors 🎉