Native.我遇到这个问题:
D:abcnode_modulesreact-nativeLibrariesCoreExceptionsManage…:71 Warning: checkPropTypes has been moved to a separate package. Accessing React.checkPropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead.
请帮助我知道这个问题。
我的应用依赖项是:
"dependencies": {
"react": "16.0.0-alpha.12",
}
作为信息,错误是 react 已将 prop-type 从 react-core 移动到另一个独立的包中,因此为了使用,您需要将其添加到您的项目中。
在 package.json 中添加另一个依赖项
"dependencies": {
"react": "16.0.0-alpha.12",
"prop-types": "15.5.8",
}
以及您过去导入的任何地方 import {PropTypes} from React
或React.PropTypes
你需要import PropTypes from 'prop-types'