Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native(iOS) Module AppRegistry is not a registered callable module (calling runApplication)

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.

like image 461
jaysig Avatar asked Oct 17 '22 01:10

jaysig


1 Answers

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
like image 79
Kevin Amiranoff Avatar answered Oct 20 '22 23:10

Kevin Amiranoff