NextJS动态路由问题
我会在NextJS中获得此错误创建博客。错误:多个孩子被传递给/
的href
,但只有一个孩子受支持
我在这里做错了什么?
============================== 服务器错误 错误:/
的href
将多个孩子传给了,但只有一个孩子被支持 https://nextjs.org/docs/messages/link-multiple-children
在生成页面时发生了此错误。任何控制台日志都将显示在终端窗口中。
<nav className={styles.main-nav}>
<ul>
<Link href='/'> <li>Home</li></Link>
<Link href='/about'> <li>About</li></Link>
<Link href='/blog'> <li>Blog</li></Link>
<Link href='/contact'> <li>Contact</li></Link>
</ul>
</nav>
I get this Error creating blog in NextJS. Error: Multiple children were passed to with href
of /
but only one child is supported
What am i doing wrong here ?
===============================
Server Error
Error: Multiple children were passed to with href
of /
but only one child is supported https://nextjs.org/docs/messages/link-multiple-children
This error happened while generating the page. Any console logs will be displayed in the terminal window.
<nav className={styles.main-nav}>
<ul>
<Link href='/'> <li>Home</li></Link>
<Link href='/about'> <li>About</li></Link>
<Link href='/blog'> <li>Blog</li></Link>
<Link href='/contact'> <li>Contact</li></Link>
</ul>
</nav>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
内部的“链接”组件必须为“”标签
Inside 'Link' component must be 'a' tag