相关疑难解决方法(0)

TS Expression 生成的联合类型过于复杂,无法用 Material-UI 和 @react- Three/Fiber 表示

我创建了一个使用 Material-UI 和 @react-two/fibre 库的 Next.js 应用程序。

我最近将Material-UI传递到V5并出现错误。

这是错误: 错误

我搜索了所有内容以将其删除,但什么也没找到。

所以我尝试使用Material-UI V5创建一个新项目,并一一安装其他依赖项。一开始,错误没有显示,但是当我安装时@react-three/fiber@react-three/drei错误出现了。

所以我发现有一个Box组件是从中导出的@material-ui@react-three/drei所以我现在明白了这个错误。

这是我的package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@emotion/react": "^11.4.0",
    "@emotion/styled": "^11.3.0",
    "@material-ui/core": "^5.0.0-beta.2",
    "@material-ui/styles": "^4.11.4",
    "@react-three/fiber": "^7.0.6",
    "next": "11.0.1",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "@types/react": "17.0.16",
    "eslint": "7.32.0",
    "eslint-config-next": "11.0.1",
    "typescript": "4.3.5"
  }
}
Run Code Online (Sandbox Code Playgroud)

我的 …

three.js typescript reactjs material-ui react-three-fiber

21
推荐指数
3
解决办法
2万
查看次数