-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug
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
The code in the playground link follows the Rules of React, but the react compiler emits a very defensive error.
The obvious bug is that ok1
doesn't trigger the error even though it could get mutated just like the others.
But this is also a false positive; the code is fine. It's not pretty, but it is correct. There's no obvious way to fix this and no documented escape hatch.
It was also way too time consuming to debug and reduce to a testcase. Maybe I'm spoiled by the rust compiler, but I'd like to see a better error message:
error1
references a value contained ina
declared in line xxx, which may be mutated later by a call topure_function
in line xxx.
How often does this bug happen?
Every time
What version of React are you using?
19.2
What version of React Compiler are you using?
latest on the playground
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug