Repository navigation
Closed
Closed
Copy link
Labels
Compiler: Ref ValidationComponent: React CompilerStatus: UnconfirmedA 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
I was previously getting an error saying, "Ref values (the current property) may not be accessed during render." However, passing a function to access the refs seems to work as a solution since there is no eslint error now.
In the repro, wrapping the refs in a function return doesn't change any functionality so I'm finding this issue to be a little odd.
The error doesn't always appear with every component. I couldn't find a reason why.
This seems to be similar to #31290
How often does this bug happen?
Sometimes
What version of React are you using?
19.0.0
What version of React Compiler are you using?
19.0.0-beta-37ed2a7-20241206
Reacted by Yaroslav Petryk, Alexander Harding and Mario-Eis
Metadata
Metadata
Assignees
Labels
Compiler: Ref ValidationComponent: React CompilerStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugType: Bug
Activity
aeharding commentedon Dec 13, 2024
Workaround: https://mantine.dev/hooks/use-merged-ref/
reactwg/react-compiler#31
josephsavona commentedon Jul 25, 2025
See #34004 which adds support for the merge refs pattern. If a function call takes refs as arguments we normally error. However, if we can infer that result of the function is also a ref — named
refor-Ref, or passed as arefprop — then we allow the call.josephsavona commentedon Jul 29, 2025
Fix landed!