i\'ve upgraded my RN app from 0.55.4 to 0.56 that use Babel 7.
In 0.55.4 to use decorators for MOBX i use \"babel-plugin-transform-decorators-legacy\" but is not com
I solved this issue by installing @babel/plugin-proposal-decorators@7.0.0-beta.47
and @babel/plugin-transform-runtime@7.0.0-beta.47
.
Versions might change for you. I used those versions because @babel/core
was also at 7.0.0-beta.47
.
Current .babelrc
is:
{
"presets": [
"react-native"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-transform-runtime", {
"helpers": true,
"polyfill": false,
"regenerator": false
}]
]
}
Ok, i solved all the errors by adding @babel/runtime
, now the app works in DEBUG
and RELEASE
too.
Here the correct configuration:
package.json
...
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
"@babel/plugin-proposal-decorators": "7.0.0-beta.47",
"@babel/plugin-transform-runtime": "7.0.0-beta.47",
"@babel/runtime": "7.0.0-beta.47",
"babel-jest": "23.2.0",
"babel-preset-react-native": "5.0.2",
"jest": "23.3.0",
"react-test-renderer": "16.4.1"
}
...
.babelrc
{
"presets": [
"react-native"
],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-transform-runtime", {
"helpers": true,
"polyfill": false,
"regenerator": false
}]
]
}
Thanks @Hkan.