/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/link-multiple-children.mdx
42 строки
892 B
Delba de Oliveira
Docs IA 2.0: Move version upgrade docs under `Guides` (#78189)
15 апр 2025, 18:00
Не верифицирован
15 апр 2025, 18:00
ae1cad0
Код
Авторство
О чём код?
--- title: 'Multiple children were passed to `<Link>`' --- ## Why This Error Occurred In your application code multiple children were passed to `next/link` but only one child is supported: For example: ```jsx filename="example.js" import Link from 'next/link' export default function Home() { return ( <Link href="/about"> <a>To About</a> <a>Second To About</a> </Link> ) } ``` ## Possible Ways to Fix It Make sure only one child is used when using `<Link>`: ```jsx filename="example.js" import Link from 'next/link' export default function Home() { return ( <Link href="/about"> <a>To About</a> </Link> ) } ``` > **Good to know**: > > - As on Next.js 13.0, `<Link>` no longer requires a child `<a>` tag. A [codemod](/docs/app/guides/upgrading/codemods#remove-a-tags-from-link-components) is provided to automatically update your codebase.