【发布时间】:2016-06-18 20:03:52
【问题描述】:
我刚刚从 0.24 更新到 RN 0.27,所有这些“超级表达式必须为空或函数,而不是未定义”错误开始弹出。经过一些研究后,我意识到 RN 0.26 发生了重大变化,因此我更改了我的导入语句,如 https://github.com/facebook/react-native/releases/tag/v0.25.1 以及有关该主题的其他 StackOverflow 帖子。更改所有组件类后,我仍然看到:
babelHelpers.js 中的继承函数是:
babelHelpers.inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function,not " + typeof superClass);
}
它有什么问题?看起来这是 react-native 库的一部分。
我知道有一个可用的转换here 来解决一般的“导入问题”。有人成功运行了吗?
顺便说一句 - 这是我当前使用的依赖项:
"dependencies": {
"@remobile/react-native-splashscreen": "^1.0.3",
"babel-polyfill": "^6.9.1",
"react": "^15.1.0",
"react-native": "^0.27.2",
"react-native-navbar": "^1.5.0",
"react-native-side-menu": "^0.18.1",
"realm": "^0.13.2"
},
"devDependencies": {
"babel-jest": "^12.1.0",
"babel-polyfill": "^6.9.1",
"jest-cli": "^12.1.1",
"react-addons-test-utils": "^15.1.0"
}
提前感谢您的帮助。
【问题讨论】:
标签: react-native babeljs