You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
It's been a while since I've worked with react-native and babel. As I recall, I fixed my problem by removing all autobind annotations and binding all the methods in the constructor manually.
I used a python script and some regex magic to do most of the replacements.
I am using RN 0.61.5, react 16.9.0, and I solve the problem by adding this line to babel.config.js
"plugins": [
["@babel/plugin-proposal-decorators", {"legacy": true}]
}
Actually I got a clue from your babel.rc file configuration @kburnik posted here.
I'm attempting to upgrade my project to react-native 0.57.1, due to a multitude of reasons and issues with the current versions of packages.
Seems core-decorators are broken by Babel 7 or something else is amiss.
I ran
Same issue with
run-ios
on mac.Essentially we only use
@autobind
on methods and these decorators seem not to work.E.g.
So this happens during runtime (i.e. the metro bundler finishes ok).
BTW, I tried using the replacement autobind-decorator package, but also get an error, seems Babel 7 isn't welcoming these decorators...
Any input would be appreciated.
My package.json
My .babelrc
BTW, this works just fine with old react-native, see my OLD package.json:
Please let me know if you had and resolved the issue or have a suggestion on how to approach this.
The text was updated successfully, but these errors were encountered: