How to fix Error: decorators-legacy - React Native
Experimental syntax 'decorators-legacy' isn't currently enabled
1.Install decorator in package.json
"@babel/plugin-proposal-decorators": "^7.3.0",
"@babel/preset-flow": "^7.0.0"
2.Update babe.config.js with this
module.exports = {
"presets": [
"module:metro-react-native-babel-preset",
"@babel/preset-flow"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy" : true }],
["@babel/plugin-proposal-class-properties", { "loose" : true }],
]
}
Top comments (0)