美文网首页
undefined is not an object (eval

undefined is not an object (eval

作者: 太阳的小号 | 来源:发表于2018-12-18 16:38 被阅读0次

我的职业生涯,差点因此而毁灭,差点坚持不下去😂,看了将近两天,这个bug

修复方法:

1.package.json
"dependencies": {

    "babel-plugin-transform-flow-strip-types": "^6.22.0",

  },

2.babelrc

{

  "presets": ["module:metro-react-native-babel-preset"],

  "plugins": [

    ["@babel/plugin-transform-flow-strip-types"],

    ["@babel/plugin-proposal-decorators", { "legacy": true }],

    ["@babel/plugin-proposal-class-properties", { "loose": true }],

    ["@babel/transform-runtime", {

      "helpers": true,

      "regenerator": false

    }]

  ]

参考链接:https://github.com/facebook/react-native/issues/20588

相关文章

网友评论

      本文标题:undefined is not an object (eval

      本文链接:https://www.haomeiwen.com/subject/nuulkqtx.html