5

I am having an issue with my app stopping at the splash screen after upgrading to handle newer devices. I'm running the following.

"react": "^16.2.0",
"react-native": "^0.51.0",

There is no error in the packager but in xCode I see the following

Unhandled JS Exception: Module AppRegistry is not a registered 
callable module (calling runApplication)

and

[tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS 
Exception: undefined is not an object (evaluating '_react2.PropTypes.oneOf')

Any help tracking down either of these errors would be appreciated.

jaysig
  • 203
  • 3
  • 10

1 Answers1

3

PropTypes have been moved away from the React package in React v16 and above.

Somewhere in your code you either have React.PropTypes or an import statement like this import { PropTypes } from 'react'

You have to change this by importing PropTypes like this:

import PropTypes from 'prop-types'; // ES6

And use it like this.

MyComponent.propTypes = {
 props: PropTypes.string
}

You also have to make sure that in your package.json inside of dependencies you have the prop-types dependency, for example by running:

npm install --save prop-types
Zoe
  • 27,060
  • 21
  • 118
  • 148
Kevin Amiranoff
  • 13,440
  • 11
  • 59
  • 90