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:
Oskar Oldorf 2023-03-01 11:01:04 +01:00 committed by GitHub
parent 494943cbdb
commit d167ecce47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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>
</>
)
}
```