Next.js Redux 无法向 Nav.tsx 添加另一个链接

问题描述 投票:0回答:1

A 使用 npx create-next-app --example with-redux my-app 启动了一个新应用程序,并尝试通过添加新文件夹(aboutme)和 page.tsx 文件来创建新组件,然后添加到我的导航中。 tsx 文件为 aboutme 页面提供一个组件。enter image description here

Ienter image description here 收到未处理的运行时错误错误 错误:默认导出不是页面中的 React 组件:“/aboutme”。 其他页面和链接工作正常。只是我添加的那个链接无法呈现。

next.js redux react-redux
1个回答
1
投票

您应该将页面创建为

pages/aboutme.tsx

© www.soinside.com 2019 - 2024. All rights reserved.