如何将 Next.js Link 与多个子项一起使用?

Shy*_*ato 3 reactjs next.js

如何Link在 Next.js 中使用多个<div>this <div>?我有 img 标签Link、链接段落、链接标题。

href错误:使用of 传递多个子项/article,但仅支持一个子项 https://nextjs.org/docs/messages/link-multiple-children 打开浏览器的控制台以查看组件堆栈跟踪。

<Link href="/article" title="">
      <div >
          <h4>{props.featurename}</h4>
          <a href="/author"><h3>{props.featuredesc}</h3></a>
      </div>
      <div className="img-entry">
          <Image src="/images/more-img.png" width={265} height={290} title="" alt="" />
      </div>
</Link>
Run Code Online (Sandbox Code Playgroud)

Ivo*_*Ivo 7

使用片段将多个元素分组到一个在树中不可见的主子元素下。(https://reactjs.org/docs/fragments.html#gatsby-focus-wrapper

      <Link ***href***="/article" title="">
       <>
        <div >
          <h4>{props.featurename}</h4>
          <a href="/author"><h3>{props.featuredesc}</h3></a>
        </div>
        <div className="img-entry">
          <Image src="/images/more-img.png" width={265} height={290} title="" alt="" />
        </div>
       </>
      </Link>
Run Code Online (Sandbox Code Playgroud)