Compiler optimization issue requiring deep understanding of React internals.
The React Compiler fails to memoize a variable (`processedData`) that should be memoized, leading to unnecessary recalculations when `onClick` changes. This requires investigating and fixing the compiler's optimization logic. The issue involves understanding React's compiler internals and may have broader implications.
Open the example from React Compiler introduction , which is linked by See this example in the React Compiler Playground
The example Component itself expects props with two properties: function ExpensiveComponent({ data, onClick })
This example from React Compiler docs doesn't memoize the first line in its body const processedData = expensiveProcessing(data);
If you look closely at the compiled output, the compiled version would recalculate that line each time when onClick is changed, even though data is the same.
If we manually add useMemo as it was in the original example fro
Claim this issue to let others know you're working on it. You'll earn 30 points when you complete it!