Skip to content

Commit

Permalink
RN: Disable Babel Plugin for Arrow Functions for Hermes (#44534)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #44534

Reapplies {D50818568} (reverted by D50885400).

Changelog:
[General][Changed] - Disable Babel plugin for arrow functions for Hermes

Reviewed By: robhogan

Differential Revision: D57242622

fbshipit-source-id: 63ec2aeb7562dbb1a049dedd6a35b10aa822193c
  • Loading branch information
yungsters authored and facebook-github-bot committed May 13, 2024
1 parent 02d2f8c commit cdc3b9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 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,9 @@ const getPreset = (src, options) => {
extraPlugins.push([require('@babel/plugin-transform-classes')]);
}

// 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 && (isNull || src.includes('=>'))) {
extraPlugins.push([require('@babel/plugin-transform-arrow-functions')]);
}

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

0 comments on commit cdc3b9c

Please sign in to comment.