reactjs - 如何将带有 material-ui 的 next.js 嵌入到 keystonejs 中?
问题描述
我正在尝试将带有 material-ui 的 nextjs 嵌入到 keystonejs 中。
我可以让 keystone 和 nextjs 一起玩,没问题。https://www.keystonejs.com/keystonejs/app-next/
而且我可以让nextjs和mui一起玩,没问题。https://github.com/mui-org/material-ui/tree/master/examples/nextjs
但是,当我尝试使用 mui 化的 nextjs 启动 keystone 时,我收到一个与invalid hooks相关的反应错误。
我尝试了该链接中的建议(检查多个 react/react-dom 安装或旧版本等),但还没有找到确凿的证据。
知道我缺少什么额外的步骤来将这一切缝合在一起吗?
这是两人相遇的地方:
# cat index.js | tail -15
module.exports = {
keystone,
apps: [
new GraphQLApp(),
new AdminUIApp({
enableDefaultRoute: false,
authStrategy,
}),
new NextApp({
dir: './nextjs', // <--- fails when mui present, works without; cd'ing in there and starting with mui (directly, without keystone) works
}),
]
};
谢谢!
解决方案
推荐阅读
- python - 通过 python 套接字发送 png 文件
- html - 签入的输入不适用于 html+php
- google-apps-script - 如何查找元素并获取行或列
- javascript - 如何通过在Javascript中拥有两个普通数组来创建具有相同键的关联数组
- azure - 如何使用 Power BI 数据流中的实体自动更新 SQL 数据库表?
- c# - 显示建议的部分文件中的格雷码
- c# - .NET Core 单元测试 Razor 页面 RedirectToPage()
- ag-grid-angular - 将网格高度设置为 100% 时不渲染 Ag 网格角度
- ios - 将 iOS 联系人提取到 tableview,但直到我单击另一个选项卡栏项目并返回 tableview 选项卡后,Tableview 数据才显示
- python - 无法在方法之外修改变量