Create-react-native-app: PropTypes and React.createClass deprecation warnings. Also react dependency issues

Created on 8 Jul 2017  ยท  2Comments  ยท  Source: expo/create-react-native-app

Description

When running tests with a newly generated react native app, there are warnings about PropTypes being moved to a separate package and React.createClass no longer being supported.

Steps to reproduce

yarn test

Expected Behavior

Expected the tests to pass with no errors or warnings

Observed Behavior

Got the following warnings although the test did pass

  console.error node_modules/fbjs/lib/warning.js:36
    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. (https://fb.me/migrating-from-react-proptypes)

  console.error node_modules/react-native/Libraries/Core/ExceptionsManager.js:71
    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. (https://fb.me/migrating-from-react-create-class)

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts:
[email protected] /mnt/Storage/Coding/AwesomeProject
โ”œโ”€โ”€ UNMET PEER DEPENDENCY [email protected]
โ””โ”€โ”€ [email protected] 

npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
  • npm ls react-native:
[email protected] /mnt/Storage/Coding/AwesomeProject
โ”œโ”€โ”€ UNMET PEER DEPENDENCY [email protected]
โ””โ”€โ”€ [email protected] 

npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
  • npm ls expo:
[email protected] /mnt/Storage/Coding/AwesomeProject
โ”œโ”€โ”ฌ [email protected] 
โ”‚ โ””โ”€โ”€ UNMET PEER DEPENDENCY react@>=15.3.1
โ””โ”€โ”€ UNMET PEER DEPENDENCY [email protected]

npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
npm ERR! peer dep missing: react@>=15.3.1, required by [email protected]
npm ERR! peer dep missing: react@>=15.4.0, required by [email protected]
  • node -v: v6.10.3
  • npm -v: 3.10.10
  • yarn --version: 0.24.6
  • watchman version: not installed

Also specify:

  1. Operating system: Ubuntu 16.04
  2. Phone/emulator/simulator & version: Genymotion

Reproducible Demo

Repo: https://github.com/tamj0rd2/react-native-example

Most helpful comment

the actual problem is -> it's not telling what exact packages are resulting this warning :/
so I don't know if those are the new dependencies I've added or the old ones

All 2 comments

The deprecation warnings are a problem with react-native upstream right now -- some parts were not updated to get rid of the deprecation warnings. This will be fixed in the next release, you can ignore those.

The react dependency warnings are a result of how npm uses semver: >= 15.0.0 will not be satisfied by 16.0.0-alpha.12, so it will show you this warning. You can use yarn if you don't want to see the warning. This will be resolved when React 16 is released, not sure what the timeline is on that though.

the actual problem is -> it's not telling what exact packages are resulting this warning :/
so I don't know if those are the new dependencies I've added or the old ones

Was this page helpful?
0 / 5 - 0 ratings

Related issues

witbybit picture witbybit  ยท  4Comments

noelweichbrodt picture noelweichbrodt  ยท  3Comments

jckuhl picture jckuhl  ยท  4Comments

andyvanosdale picture andyvanosdale  ยท  3Comments

ArashMotamedi picture ArashMotamedi  ยท  3Comments