Open lukpsaxo opened 2 hours ago
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAKgmDgBTBEC2AhgJ4BGCAclADacA0RAvgEoiwADrEicQhUnMiAXiJQwCAML1uzenADWlSsPkA+EeKLmiaTNSIAPZHSasO3AHS2BggNxmBfANoMLOxcvAC63uK+MAg4sMRBzqFEAPxEADxgAA70xAD0Jg7pACZ4AG5EhKqceLrywHDM-EQFPpj8IPxAA
Similiar to https://github.com/facebook/react/issues/31550 but with useCallback and no external deps.
You seem to assume that accessing x.y is safe in the render method if it is safe in a callback.
x.y
Every time
18.3.1
19.0.0-beta-a7bf2bd-20241110
Similiar to https://github.com/facebook/react/issues/31269 but that is fixed on the playground and this is not.
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAKgmDgBTBEC2AhgJ4BGCAclADacA0RAvgEoiwADrEicQhUnMiAXiJQwCAML1uzenADWlSsPkA+EeKLmiaTNSIAPZHSasO3AHS2BggNxmBfANoMLOxcvAC63uK+MAg4sMRBzqFEAPxEADxgAA70xAD0Jg7pACZ4AG5EhKqceLrywHDM-EQFPpj8IPxAA
Repro steps
Similiar to https://github.com/facebook/react/issues/31550 but with useCallback and no external deps.
You seem to assume that accessing
x.y
is safe in the render method if it is safe in a callback.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?
19.0.0-beta-a7bf2bd-20241110