首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IconComponent: PropTypes.elementType.isRequired ( material ui )错误

IconComponent: PropTypes.elementType.isRequired ( material ui )错误
EN

Stack Overflow用户
提问于 2019-09-26 14:49:35
回答 1查看 624关注 0票数 1

我曾尝试将material ui从v3迁移到v4,但遇到了此问题

我认为这个问题与Select组件的prop IconComponent有关,但在将其添加到项目中的每个@material-ui/core/Select组件后,它并没有帮助。

另外,我在material ui github存储库https://github.com/mui-org/material-ui/pull/17390/files中发现了这种变化,也许它会有所帮助

你也可以在下面找到我的所有依赖项:

代码语言:javascript
复制
 "dependencies": {
    "@babel/runtime": "^7.6.2",
    "@date-io/date-fns": "0.0.2",
    "@material-ui/core": "4.4.3",
    "@material-ui/icons": "3.0.1",
    "@material-ui/pickers": "3.2.6",
    "@material-ui/styles": "^4.4.3",
    "axios": "0.19.0",
    "classnames": "2.2.6",
    "compression-webpack-plugin": "3.0.0",
    "connected-react-router": "6.4.0",
    "date-fns": "2.0.0-alpha.27",
    "enzyme": "3.10.0",
    "enzyme-adapter-react-16": "1.14.0",
    "history": "4.6.3",
    "humps": "2.0.0",
    "jss": "^10.0.0",
    "jss-camel-case": "6.1.0",
    "jss-default-unit": "8.0.2",
    "jss-expand": "5.3.0",
    "jss-extend": "6.2.0",
    "jss-global": "3.0.0",
    "jss-nested": "6.0.1",
    "jss-props-sort": "6.0.0",
    "jss-vendor-prefixer": "8.0.1",
    "lodash": "4.17.14",
    "moment": "2.23.0",
    "normalizr": "3.3.0",
    "prop-types": "15.6.2",
    "qs": "6.5.2",
    "react": "16.8.6",
    "react-dom": "16.8.6",
    "react-dropzone": "10.1.4",
    "react-hot-loader": "4.8.8",
    "react-image": "2.1.1",
    "react-intl": "2.7.2",
    "react-intl-po": "2.2.2",
    "react-intl-redux": "2.0.2",
    "react-motion": "0.5.2",
    "react-pose": "4.0.8",
    "react-redux": "7.0.3",
    "react-router": "4.3.1",
    "react-router-dom": "4.3.1",
    "react-spinners": "0.4.7",
    "react-universal-component": "4.0.0",
    "recompose": "0.30.0",
    "redux": "4.0.1",
    "redux-axios-middleware": "4.0.0",
    "redux-devtools-extension": "2.13.8",
    "redux-form": "8.2.2",
    "redux-form-validators": "^3.2.2",
    "redux-immutable-state-invariant": "2.1.0",
    "redux-logger": "3.0.6",
    "redux-thunk": "2.3.0",
    "store2": "2.7.1",
    "uglifyjs-webpack-plugin": "2.0.1"
  },
EN

回答 1

Stack Overflow用户

发布于 2019-09-26 15:26:00

是在prop-types 15.7.0中添加的,而您正在使用15.6.2

将prop-type升级到15.7.0或更高版本,错误应该会消失。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58111027

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档