RN Exception: Support for the experimental syntax 'decorators-legacy' isn't currently enabled

异常

Support for the experimental syntax 'decorators-legacy' isn't currently enabled (17:1):
异常.png

解决方法

  1. npm install @babel/plugin-proposal-decorators

  2. 在.babelrc文件中添加

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

你可能感兴趣的:(RN Exception: Support for the experimental syntax 'decorators-legacy' isn't currently enabled)