Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property 'string' of undefined | React.PropTypes | LayoutPropTypes.js

After deleting and reinstalling my node_modules folder, I'm facing an issue that I don't understand in LayoutPropTypes.js file.

In node_modules/react-native/Libraries/StyleSheet/LayoutPropTypes.js The following variable is undefined : var ReactPropTypes = require('React').PropTypes;

react-native: 0.45.1 react: 16.0.0-alpha.12

like image 584
Nicolas Meienberger Avatar asked Sep 09 '25 17:09

Nicolas Meienberger


1 Answers

React.PropTypes is now deprecated:

Note: React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead.

You need to add the prop-types package separately now. The error most likely just started to show up because you deleted your node_modules folder and then reinstalled everything which upgraded your react version.

like image 68
Chase DeAnda Avatar answered Sep 12 '25 10:09

Chase DeAnda