Open
Description
What kind of issue is this?
- React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
- babel-plugin-react-compiler (build issue installing or using the Babel plugin)
- eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Repro steps
React compiler fails to optimize components that contain for await
loops. I came across this bug while trying to deduce the cause of a significant amount of re-renders. In the react dev tools it showed the component was indeed auto-memoized, however it would still re-rerender when seeing the same props. When removing for await
from my code the component properly memoized inputs.
Later I tested this in the react compiler playground and noticed the very clear Todo: (BuildHIR::lowerStatement) Handle for-await loops (10:12)
error message. Ideally this error could be addressed or surfaced to the user in order to prevent confusion on why a component marked as auto-memoized isn't actually being memoized.
How often does this bug happen?
Every time
What version of React are you using?
19.1
What version of React Compiler are you using?
rc