mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RN/Metro: Configure Transformer for React 19 (#50809)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50809 Configures `react-native/metro-babel-transformer` (used by `react-native/babel-preset`) to parse source using `hermes-parser` to target React 19. This changes components written with Component Syntax to stop generating `forwardRef` calls (because `ref` is now a prop). Most of this was already accomplished in https://github.com/facebook/react-native/pull/50377 ({D72070021}), but this call site was missed. Changelog: [General][Changed] - Configured Hermes Parser to target React 19, resulting in Component Syntax no longer producing `forwardRef` calls. Reviewed By: elicwhite Differential Revision: D73279825 fbshipit-source-id: c0d64cb8c0adb22b78c5fbed1b2c386c8b3f3ede
This commit is contained in:
committed by
Facebook GitHub Bot
parent
db6e000023
commit
f2518d4374
@@ -210,6 +210,7 @@ const transform /*: BabelTransformer['transform'] */ = ({
|
||||
: // $FlowFixMe[incompatible-exact]
|
||||
require('hermes-parser').parse(src, {
|
||||
babel: true,
|
||||
reactRuntimeTarget: '19',
|
||||
sourceType: babelConfig.sourceType,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user