docs: Remove superfluous <PagesOnly> tags in api-reference/components/link.mdx (#62501)

Within the document
[docs/02-app/02-api-reference/01-components/link.mdx](https://github.com/zhuyedev/next.js/blob/canary/docs/02-app/02-api-reference/01-components/link.mdx#L327),
there is an unnecessary set of `<PagesOnly>` tags, which prevents a few
sections from being displayed correctly.This issue particularly affects
the section starting with "### If the child is a custom component that
wraps an <a> tag" (in line 327) and ending just before "### Middleware"
(in line 458).

Co-authored-by: Sam Ko <sam@vercel.com>
This commit is contained in:
Ye Zhu 2024-02-27 01:20:41 +08:00 committed by GitHub
parent e60cb36d54
commit 0d1b11fba3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -324,8 +324,6 @@ function Page({ posts }) {
</AppOnly>
<PagesOnly>
### If the child is a custom component that wraps an `<a>` tag
<AppOnly>
@ -455,8 +453,6 @@ The default behavior of `Link` is to scroll to the top of the page. When there i
</Link>
```
</PagesOnly>
### Middleware
It's common to use [Middleware](/docs/app/building-your-application/routing/middleware) for authentication or other purposes that involve rewriting the user to a different page. In order for the `<Link />` component to properly prefetch links with rewrites via Middleware, you need to tell Next.js both the URL to display and the URL to prefetch. This is required to avoid un-necessary fetches to middleware to know the correct route to prefetch.