react-native run-android reports the following error
undefined is not an object evaluating ReactInternals.ReactCurrentOwner
As shown below:
The reason is expected to be a problem with the RN version.
Reference:
https://github.com/facebook/r...
Solution
As I mentioned, make sure you've installed the correct version of React. If you're using React Native 0.45:
yarn add react@16.0.0-alpha.12
[After referring to the solutions, the problem still hasn’t been solved. I don’t know what to do now. What is the reason for this problem? How to solve it? 】
The following is my package.jason file.
{
"name": "ReactNativeWeb",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"react": "^16.0.0-alpha.12",
"react-dom": "^16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-native-web": "0.0.103",
"webpack": "^2.6.1"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "2.0.0",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12",
"webpack-dev-server": "^2.4.5"
},
"jest": {
"preset": "react-native"
}
}
Finally lowering the react version solved the problem
I also encountered this problem. I upgraded through the official react-native-git-upgrade, react:16.0.0-alpha.12, react-native:0.45.1, and reported the error Module AppRegistry is not a registered callable module (calling runApplication)
Now I am using the previous react:16.0.0-alpha.6, react-native:0.43.4 also reported this error, I don’t know how to solve it
I also want to ask how beneficial it is to upgrade the rn version, I think Upgrading once brings many problems