Skip to content

Commit

Permalink
Back out "Apply Babel arrow transform only when needed" (facebook#41282)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#41282

Original commit changeset: ad96540bb777

Original Phabricator Diff: D50818568

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D50885400

fbshipit-source-id: b5039b6430e48a3b87456758bf4fef6cc182ee8f
  • Loading branch information
GijsWeterings authored and Othinn committed Jan 9, 2024
1 parent de181c1 commit d3ca016
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react-native-babel-preset/src/configs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ const getPreset = (src, options) => {
extraPlugins.push([require('@babel/plugin-transform-classes')]);
}

if (!isHermes && (isNull || src.indexOf('=>') !== -1)) {
extraPlugins.push([require('@babel/plugin-transform-arrow-functions')]);
}
// TODO(gaearon): put this back into '=>' indexOf bailout
// and patch react-refresh to not depend on this transform.
extraPlugins.push([require('@babel/plugin-transform-arrow-functions')]);

if (!isHermes) {
extraPlugins.push([require('@babel/plugin-transform-computed-properties')]);
extraPlugins.push([require('@babel/plugin-transform-parameters')]);
Expand Down

0 comments on commit d3ca016

Please sign in to comment.