silverwolf-x/project / errors /invalid-new-link-with-extra-anchor.mdx
silverwolf-x's picture
download
raw
546 Bytes
---
title: 'Invalid `<Link>` with `<a>` child'
---
## Why This Error Occurred
Starting with Next.js 13, `<Link>` renders as `<a>`, so attempting to use `<a>` as a child is invalid.
## Possible Ways to Fix It
Run the `new-link` codemod to automatically upgrade previous versions of Next.js to the new `<Link>` usage:
```bash filename="Terminal"
npx @next/codemod new-link .
```
This will change `<Link><a id="link">Home</a></Link>` to `<Link id="link">Home</Link>`.
## Useful Links
- [next/link](/docs/pages/api-reference/components/link)

Xet Storage Details

Size:
546 Bytes
·
Xet hash:
c763bbb7d681283bdd2f4bfd2f5f7e4b2c803b09c216a4591733fc276b16d3a0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.