-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add legacy decorator support for TypeScript files #5642
Comments
@Timer Used craco so far to turn decorators on (use it for mobx), but if cra would support it, that would be great! |
Looking forward to this going in 2.1.1 - the decorators are the one thing preventing me from migrating to react-scripts from react-scripts-ts |
I've just hit this, trying to port an app using MobX. |
@AndyCJ Warning if you use MobX with |
@metawave that plugin should already be included in CRA |
@metawave That package was added 2 months ago: https://github.com/facebook/create-react-app/blame/fbfa21621ae3c2a66e63daeca1a98beb09860227/packages/babel-preset-react-app/package.json#L21 Unless I'm missing something? EDIT: Interestingly I currently have a EDIT 2: It was a mistake on my part, I was dereferencing an observable in a render callback, which isn't monitored by |
I do see a difference when compiling. On a vanilla project created with cli, the decorators on class fields don't get transpiled:
for typescript file
Only when configuring babel to use this plugin, the resulting code is complete:
|
Hmm, that sounds like a bug. Can you file a new issue please? |
done! #5741 |
Oops, looks like we forgot to turn legacy decorators on:
I'm surprised there hasn't been a complaint yet!
The text was updated successfully, but these errors were encountered: