undefined is not an object evaluating ReactInternals.ReactCurrentOwner

来源:1-4 项目结构介绍

大苗子

2017-06-18

react-native run-android 如下报错

undefined is not an object evaluating ReactInternals.ReactCurrentOwner

如下图:

http://szimg.mukewang.com/5945bbc200016bc103570606.jpg

预计原因是RN版本的问题

参考:

https://github.com/facebook/react-native/issues/13874

解决办法

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

【参考了解决办法,还是没解决问题,不知道现在要怎么办了。出现这个问题是什么原因?要怎么解决?】

以下是我的package.jason文件。

{
	"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"
	}
}




写回答

1回答

CrazyCodeBoy

2017-06-19

关闭rn的服务器,重新运行项目试一下,如果不行打开断点调试看能否定位到问题

0
0

React Native技术精讲与高质量上线App开发

一个真实的上线项目,一次完整的开发过程,全面掌握React Native技术

1577 学习 · 727 问题

查看课程