本机反应中超出最大调用堆栈大小

时间:2017-09-12 07:51:22

标签: reactjs react-native babeljs react-async

我正在使用本机反应,一切正常,直到我在package.json中引入了以下的库

    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-3": "^6.24.1",

还更新了.babelrc

{
  "presets": ["es2015", "react-native", "babel-preset-stage-3"]
}

但是现在我在运行应用程序时收到超出最大调用堆栈大小。我添加了上面的依赖项来获取async / await函数。

我的package.json看起来像这样

{
  "name": "pilbara_weed_management_mobile",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-3": "^6.24.1",
    "react": "16.0.0-alpha.12",
    "react-native": "0.47.2",
    "react-native-root-toast": "^1.3.0",
    "react-native-smart-splash-screen": "^2.3.5",
    "react-native-snackbar-dialog": "^1.3.0",
    "react-navigation": "^1.0.0-beta.11"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "3.0.1",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
    "preset": "react-native"
  }
}

即使删除依赖项后,我仍然会收到相同的错误。知道出了什么问题吗? enter image description here

1 个答案:

答案 0 :(得分:0)

其中一些已经由react& react-native并且无限循环async/await函数包含在react native中而不添加额外的依赖项