From d397832e01a54449e59a79f991bdb798cea77e81 Mon Sep 17 00:00:00 2001
From: kevinmitch14 <55989505+kevinmitch14@users.noreply.github.com>
Date: Fri, 16 Feb 2024 16:43:11 -0300
Subject: [PATCH] Docs: update link.mdx (#61508)
Updated paths in relation to `` 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: `Profile`.
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]'`.
---
docs/02-app/02-api-reference/01-components/link.mdx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/02-app/02-api-reference/01-components/link.mdx b/docs/02-app/02-api-reference/01-components/link.mdx
index 7e46c17459a2a..bd5a98062d0cd 100644
--- a/docs/02-app/02-api-reference/01-components/link.mdx
+++ b/docs/02-app/02-api-reference/01-components/link.mdx
@@ -484,7 +484,7 @@ import useIsAuthed from './hooks/useIsAuthed'
export default function Page() {
const isAuthed = useIsAuthed()
- const path = isAuthed ? '/auth/dashboard' : '/dashboard'
+ const path = isAuthed ? '/auth/dashboard' : '/public/dashboard'
return (
Dashboard
@@ -495,7 +495,7 @@ export default function Page() {
-> **Good to know**: If you're using [Dynamic Routes](/docs/app/building-your-application/routing/dynamic-routes), you'll need to adapt your `as` and `href` props. For example, if you have a Dynamic Route like `/dashboard/[user]` that you want to present differently via middleware, you would write: `Profile`.
+> **Good to know**: If you're using [Dynamic Routes](/docs/app/building-your-application/routing/dynamic-routes), you'll need to adapt your `as` and `href` props. For example, if you have a Dynamic Route like `/dashboard/authed/[user]` that you want to present differently via middleware, you would write: `Profile`.