0f195f0270
Co-authored-by: Tim Neutkens <tim@timneutkens.nl> Fixes https://github.com/vercel/next.js/issues/42715
689 B
689 B
Dynamic href
is not supported in the /app
directory
Why This Error Occurred
You have tried to use a dynamic href
with next/link
in the app
directory. This is not supported as the new client-side router no longer uses a mapping of dynamic routes -> url, instead it always leverages the url.
Possible Ways to Fix It
Before
<Link
href={{
pathname: '/route/[slug]',
query: { slug: '1' },
}}
>
link
</Link>
Or
<Link href="/route/[slug]?slug=1">link</Link>
After
<Link href="/route/1">link</Link>