Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually calling a React.PropTypes validation React native "^0.30.0"

Tags:

I have upgraded to the latest version of React/RN: "react": "^15.2.1", "react-native": "^0.30.0",

And I am starting to get a lot of warnings regarding the stylesheets. I am actually not using React.PropTypes validation for the style sheets, so why is throwing these warnings?

const styles = StyleSheet.create({     welcome: {         fontSize: 20,         textAlign: "center",         margin: 10,     }, 

ExceptionsManager.js:76 Warning: You are manually calling a React.PropTypes validation function for the fontSize prop on StyleSheet welcome. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://facebook.github.io/react/warnings/dont-call-proptypes.html for details.reactConsoleError @

ExceptionsManager.js:76 Warning: You are manually calling a React.PropTypes validation function for the textAlign prop on StyleSheet welcome. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://facebook.github.io/react/warnings/dont-call-proptypes.html

ExceptionsManager.js:76 Warning: You are manually calling a React.PropTypes validation function for the margin prop on StyleSheet welcome. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://facebook.github.io/react/warnings/dont-call-proptypes.html for details.

like image 454
Shivam Sinha Avatar asked Aug 01 '16 03:08

Shivam Sinha


2 Answers

React native 0.30 was dependent on react 15.2.0 not 15.2.1. So you should do rm -rf node_modules/react, remove the react version from package.json, then npm install --save [email protected]. This should do the trick.

like image 69
Ion Vlad-Doru Avatar answered Sep 22 '22 22:09

Ion Vlad-Doru


I resolved the issue by changing versions (removing from node_modules and installing packages).

npm --save remove react react-native npm --save install [email protected] [email protected] 

I didn't re-deploy native code. I was seeing the issues previously when using:

"react": "^15.3.0", "react-native": "^0.31.0" 
like image 45
Heath Avatar answered Sep 21 '22 22:09

Heath