How to fix Error: decorators-legacy - React Native
Andi Rustianto
Posted on June 23, 2022
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 }],
]
}
💖 💪 🙅 🚩
Andi Rustianto
Posted on June 23, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.