-
Notifications
You must be signed in to change notification settings - Fork 50.2k
Closed
Labels
Compiler: Ref ValidationComponent: React CompilerStatus: 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
- Create a component A
- Add a prop P to component A. This prop must be a render function that receives a
RefObjectand returns aReactNode - Use the
useRefhook in component A and initialize it with null - Invoke the render function passed in prop P with the ref from the previous step
Notes:
- I'm not absolutely certain if this is an error on the compiler plugin or if I am not fully understanding what the error is supposed to be. If it is an error on my end, then I would say this error message needs to be improved.
- The repro link has a complete example of a scenario where this error could arise. The bug itself is only triggered in the
MuteControlscomponent. - The only ref value access in the repro link (
videoRef.current) is in theonClickfunction of the button inMuteControls. Commenting this does not make the error disappear, so the error is triggered without any value access - Using
useMemoto memoize therenderVideocall does not make the error dissapear neither
How often does this bug happen?
Every time
What version of React are you using?
18.3.1
What version of React Compiler are you using?
Metadata
Metadata
Assignees
Labels
Compiler: Ref ValidationComponent: React CompilerStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug