未找到 Primereact 导入

Primereact Imports not Found

我想用 Primereact 框架开发一个 React Js 应用程序。 现在我遇到了找不到某些导入的问题。

Import import {Button} from 'primereact/Button' 抛出异常: 找不到文件:'Button.js' 与磁盘上的相应名称不匹配:'.\node_modules\primereact\button.js

我遇到的第二个问题是找不到DatatableSubMenu 和DatatableCrudDocu。什么是正确的导入?

我的package.json是:

"name": "selldesk",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "bootstrap": "^4.3.1",
    "primeicons": "^2.0.0",
    "primereact": "^3.3.2",
    "react": "^16.12.0",
    "react-bootstrap": "^1.0.0-beta.16",
    "react-dom": "^16.12.0",
    "react-scripts": "3.2.0",
    "reactstrap": "^8.1.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

我希望有人能帮助我。

是你导入的按钮有误。

改变这个

import {Button} from 'primereact/Button'; //uppercase

import {Button} from 'primereact/button'; //lowercase

确保将它们保持小写。检查文档以获取正确的导入语句 -

https://www.primefaces.org/primereact/#/button