Skip to content

Commit d167ecc

Browse files
divslingerijjktimneutkens
authored
Documentation: Update link-no-children error page for new link (vercel#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]>
1 parent 494943c commit d167ecc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

errors/link-no-children.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ import Link from 'next/link'
1111

1212
export default function Home() {
1313
return (
14-
<Link href="/about"></Link>
15-
// or
16-
<Link href='/about' />
14+
<>
15+
<Link href="/about" legacyBehavior></Link>
16+
// or
17+
<Link href="/about" legacyBehavior />
18+
</>
1719
)
1820
}
1921
```
@@ -27,9 +29,13 @@ import Link from 'next/link'
2729

2830
export default function Home() {
2931
return (
30-
<Link href="/about">
31-
<a>To About</a>
32-
</Link>
32+
<>
33+
<Link href="/about">To About</Link>
34+
// or
35+
<Link href="/about" legacyBehavior>
36+
<a>To About</a>
37+
</Link>
38+
</>
3339
)
3440
}
3541
```

0 commit comments

Comments
 (0)