Documentation: Update link-no-children error page for new link (#46514)
The example still has an `<a>` inside the `<Link>` which was deprecated with next 13. Current page: https://nextjs.org/docs/messages/link-no-children <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Documentation / Examples - [x] Make sure the linting passes by running `pnpm build && pnpm lint` - [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) --------- Co-authored-by: JJ Kasper <jj@jjsweb.site> Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
This commit is contained in:
parent
494943cbdb
commit
d167ecce47
1 changed files with 12 additions and 6 deletions
|
@ -11,9 +11,11 @@ import Link from 'next/link'
|
|||
|
||||
export default function Home() {
|
||||
return (
|
||||
<Link href="/about"></Link>
|
||||
// or
|
||||
<Link href='/about' />
|
||||
<>
|
||||
<Link href="/about" legacyBehavior></Link>
|
||||
// or
|
||||
<Link href="/about" legacyBehavior />
|
||||
</>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
@ -27,9 +29,13 @@ import Link from 'next/link'
|
|||
|
||||
export default function Home() {
|
||||
return (
|
||||
<Link href="/about">
|
||||
<a>To About</a>
|
||||
</Link>
|
||||
<>
|
||||
<Link href="/about">To About</Link>
|
||||
// or
|
||||
<Link href="/about" legacyBehavior>
|
||||
<a>To About</a>
|
||||
</Link>
|
||||
</>
|
||||
)
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue