@samitouri / QOS-React / commits / 91e4f0712e

[compiler] Repro for outlining bug in funcexprs

I discovered this compiler crash while trying to do an internal sync of the compiler. Any kind of outlining appears to crash the babel plugin when the component is a function expression. ghstack-source-id: 4f717674af91d4d4b730e64cbd7a144b9faab13e Pull Request resolved: https://github.com/facebook/react/pull/30443

Lauren Tan committed Jul 24, 2024 at 15:57 UTC 91e4f0712ec6da30b01054cab439d985798a9ebb
2 files changed +33
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.bug-outlining-in-func-expr.expect.md new
+24
@@ -0,0 +1,24 @@
1 +
2 +## Input
3 +
4 +```javascript
5 +const Component2 = props => {
6 + return (
7 + <ul>
8 + {props.items.map(item => (
9 + <li key={item.id}>{item.name}</li>
10 + ))}
11 + </ul>
12 + );
13 +};
14 +
15 +```
16 +
17 +
18 +## Error
19 +
20 +```
21 +Invalid value used in weak set
22 +```
23 +
24 +
\ No newline at end of file
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.bug-outlining-in-func-expr.js new
+9
@@ -0,0 +1,9 @@
1 +const Component2 = props => {
2 + return (
3 + <ul>
4 + {props.items.map(item => (
5 + <li key={item.id}>{item.name}</li>
6 + ))}
7 + </ul>
8 + );
9 +};