dillon1000/react

Commit

[compiler] InlineJSXTransform transforms jsx inside function expressions (#31282)

InlineJSXTransform wasn't traversing into function expressions or object
methods, so any JSX inside such functions wouldn't have gotten inlined.
This PR updates to traverse nested functions to transform all JSX within
a hook or component.

Note that this still doesn't transform JSX outside of components or
hooks, ie in standalone render helpers.
Browse files
Changed paths3 files
First-parent comparison
M compiler/packages/babel-plugin-react-compiler/src/Optimization/InlineJsxTransform.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inline-jsx-transform.expect.md ModifiedM compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inline-jsx-transform.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…