Search code examples
react-nativemobile-application

React Native issue on checkPropTypes


Native. I am getting this issue:

D:\abc\node_modules\react-native\Libraries\Core\ExceptionsManage…: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.

Please help me to know this issue.

My app dependency is:

"dependencies": {
    "react": "16.0.0-alpha.12",
}

Solution

  • as informative the error is react has moved the prop-types from react-core to another independent package , so in order to use you need to add that to your project.

    add another dependency in package.json

    "dependencies": { "react": "16.0.0-alpha.12", "prop-types": "15.5.8", }

    and wherever you used to import import {PropTypes} from React or React.PropTypes

    you need to import PropTypes from 'prop-types'