next.js
d397832e - Docs: update link.mdx (#61508)

Commit
1 year ago
Docs: update link.mdx (#61508) Updated paths in relation to `<Link />` and middleware rewrites. Feel free to leave suggestions if needed, this has always confused me a little bit. **Old Version**: For example, if you have a Dynamic Route like `/dashboard/[user]` that you want to present differently via middleware, you would write: `<Link href={{ pathname: '/dashboard/authed/[user]', query: { user: username } }} as="/dashboard/[user]">Profile</Link>`. The `as` prop should be the URL we want to display while href/pathname is the actual path. So if we want to present something differently via middleware, we would do so via `as`. In the example above we want to display `/dashboard/[user]` differently but we use `as='/dashboard/[user]'`.
Author
Parents
Loading