My Expo XDE is giving me the following warning on a newly created project:
1:37:35 PM 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.
1:37:35 PM Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
1:37:35 PM Warning: PropTypes has been moved to a separate package. Accessing React.PropTypes is no longer supported and will be removed completely in React 16. Use the prop-types package on npm instead.
Even though my code seems to be fine.. does anyone know why I still get this message or what is wrong with the following code?
Code
import React, {Component} from 'react';
import Root from './src/Root';
import {View} from 'react-native';
import PropTypes from 'prop-types';
class App extends Component {
render() {
return (<View />);
}
}
App.PropTypes = {}
export default App;
package.json
{
"name": "WeDo",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.2.1",
"jest-expo": "~20.0.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^20.0.0",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "^0.47.0"
}
}
The property on
App
should bepropTypes
notPropTypes
. You still usePropTypes
within the object, however.For example: