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
Sometimes you need a shared, mutable value that isn’t tied to the UI but is used across multiple components. In these cases, you don’t want React to trigger re-renders when the value changes. To handle this, you can store the value in a ref and pass it down through context.
However, when a child component mutates this value (for example, inside an event handler), the compiler currently produces an error and causes optimizations to be skipped. I feel this is too restricted for what is otherwise a legitimate React pattern.
How often does this bug happen?
Every time
What version of React are you using?
19.1.0
What version of React Compiler are you using?
19.1.0-rc.1