Skip to content

Commit

Permalink
Documentation: Update link-no-children error page for new link (verce…
Browse files Browse the repository at this point in the history
…l#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 <[email protected]>
Co-authored-by: Tim Neutkens <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2023
1 parent 494943c commit d167ecc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions errors/link-no-children.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 />
</>
)
}
```
Expand All @@ -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>
</>
)
}
```

0 comments on commit d167ecc

Please sign in to comment.