React Native,缺少类属性转换

时间:2018-06-28 13:25:35

标签: react-native babeljs

当我运行react-native run-ios时,我的应用可以正确运行,但是当我执行react-native run-android时,我会收到一条错误消息:

.../node_modules/react-native/Libraries/ART/ReactNativeART.js: Missing class properties transform.

enter image description here

看来通天塔出了什么问题?

我的.babelrc是这样的:

{
  "passPerPreset": true,
  "plugins": [
      "transform-class-properties",
      "transform-inline-environment-variables"
  ],
  "presets": [
      "react-native"
  ]
}

package.json中的babel软件包是:

"devDependencies": {
    "babel-eslint": "^8.0.2",
    "babel-plugin-remove-comments": "^2.0.0",
    "babel-plugin-transform-inline-environment-variables": "^0.4.3",
    "babel-preset-react-native": "^4.0.0",
    "babel-jest": "23.0.1",
    "babel-plugin-transform-class-properties": "6.24.1",
  }

有人知道什么地方可能出问题吗?

0 个答案:

没有答案