rsnext/errors/link-no-children.md
JJ Kasper 72478c5c80
Update next/link error when no children are provided (#35453)
* Update next/link error when no children are provided

* update manifest

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-22 13:58:55 -05:00

542 B

No children were passed to

Why This Error Occurred

In your application code next/link was used without passing a child:

For example:

import Link from 'next/link'

export default function Home() {
  return (
    <Link href="/about"></Link>
    // or
    <Link href='/about' />
  )
}

Possible Ways to Fix It

Make sure one child is used when using <Link>:

import Link from 'next/link'

export default function Home() {
  return (
    <Link href="/about">
      <a>To About</a>
    </Link>
  )
}