【发布时间】:2018-08-01 04:34:41
【问题描述】:
我正在编写一个应用程序,一切都很好,直到我不得不安装和使用 react-native-router-flux。 它的版本似乎有问题,但我找不到。 这是我得到的错误(来自我导入 react-native-router-flux 的行):
undefined is not an object (evaluating 'ReactInternals.ReactCurrentOwner')
我已经搜索过了,但没有任何建议有效! 如果有人可以帮助我,不胜感激。
package.json:
{
"name": "Manager",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"babel-preset-react-native": "^2.1.0",
"firebase": "^5.0.3",
"react": "^16.0.0-alpha.3",
"react-addons-pure-render-mixin": "^15.5.0",
"react-native": "^0.55.4",
"react-native-router-flux": "^3.43.0",
"react-redux": "^5.0.7",
"react-static-container": "^1.0.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"babel-jest": "23.4.2",
"jest": "23.4.2",
"react-test-renderer": "^16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
P.S:当我尝试更新我的 react-native-router-flux 时,我从 npm 收到此错误:
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
【问题讨论】:
-
尝试使用 react 版本
react@16.0.0-alpha.12-npm i react@16.0.0-alpha.12 --save -
@AravindS 出人意料地成功了!!!谢谢
-
很高兴知道。我会将其添加为答案,接受它,以便对寻找类似问题的其他人有所帮助
标签: reactjs react-native react-redux react-native-router-flux