-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Interpolating dynamic href values doesn't preserve extra query params #16851
Comments
Hi @herrstucki this change should now be available in |
@ijjk Works like a charm, thanks! Another thing I noticed: when I provide fewer params than necessary, the url resolves to the index page without warning, e.g. |
I'm getting the same error with this component
with a folder structure 'pages/members/businesses/edit/[id].tsx i've been working on trying to satisfy the error but to no avail |
Same here. 😢 @ijjk , please, see this. 🙏 |
Bug report
This is a feedback to #16774 which I'm very excited about since it solves a big pain point in most apps I've been writing!
Describe the bug
Adding extra query params to the
href
prop doesn't construct the expected URL; only the dynamic params are interpolated, while the extra query params are omitted.To Reproduce
Create a Next.js Link with more params than specified by the dynamic route.
Navigates to the URL
/posts/1
and creates the link<a href="/posts/1">...</a>
, omittinganotherParam
.Expected behavior
As I wrote in #14959 :
{ pathname: "/posts/[id]", query: { id: 1, anotherParam: 2 } }
should create the URL/posts/1?anotherParam=2
and the link should be<a href="/posts/1?anotherParam=2">...</a>
.System information
The text was updated successfully, but these errors were encountered: