React Native (iOS) AppRegistry module is not a registered called module (runApplication call)

I have a problem with my application stopping on the splash screen after updating to handle new devices. I am running the following.

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

There is no error in the package, 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 any of these errors would be appreciated.

+5
source share
1 answer

PropTypes have been removed from the React package in React v16 and later.

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

You should change this by importing PropTypes as follows:

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

And use it like that.

MyComponent.propTypes = {
 props: PropTypes.string
}

, package.json dependencies dependencies prop-types, , :

npm install --save prop-types
+3

Source: https://habr.com/ru/post/1690997/


All Articles