What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAggBTBEBuAhgDZgA0RAdGwA4wTthEC+ASiLAAOsSJxCYHETREAvETK06UBGCHyAfNXpqwLALY12ZZZp1UiAaiKduBtBAgCA3GKJEYCHLGIAeABM8Ki1gNGV6DT5-AHpg0PdMPjExDGx8QiIAITJ7HiFRcUlMaVkFJRV9C11VdSMTMyoaq1t8x2c3Dy8fPyIgkLCI9pYVaLiErSS+EEYQErQ8AHMUECLPWNjJQ3Y8OhpMzABZCECEZCIREHo6K7EZubAACwgAdwBJTBwEGEwolDQUQQfCAA
Repro steps
When we destructure a component's props into another object, the compiled component is less optimal than it could be. In the playground for component A, we only need props.foo in the function, but the compiled component checks for props changing. If we don't use the destructed props (see B) then the compiled result checks for props.foo changing, which is more optimal.
Destructuring props into an object in a component is a fairly common pattern, so this has the potential to significantly reduce the efficiency of React Compiler optimizations.
How often does this bug happen?
Every time
What version of React are you using?
18.2.0
What version of React Compiler are you using?
0.0.0-experimental-a1856f3-20260409
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAggBTBEBuAhgDZgA0RAdGwA4wTthEC+ASiLAAOsSJxCYHETREAvETK06UBGCHyAfNXpqwLALY12ZZZp1UiAaiKduBtBAgCA3GKJEYCHLGIAeABM8Ki1gNGV6DT5-AHpg0PdMPjExDGx8QiIAITJ7HiFRcUlMaVkFJRV9C11VdSMTMyoaq1t8x2c3Dy8fPyIgkLCI9pYVaLiErSS+EEYQErQ8AHMUECLPWNjJQ3Y8OhpMzABZCECEZCIREHo6K7EZubAACwgAdwBJTBwEGEwolDQUQQfCAA
Repro steps
When we destructure a component's props into another object, the compiled component is less optimal than it could be. In the playground for component
A, we only needprops.fooin the function, but the compiled component checks forpropschanging. If we don't use the destructed props (seeB) then the compiled result checks forprops.foochanging, which is more optimal.Destructuring props into an object in a component is a fairly common pattern, so this has the potential to significantly reduce the efficiency of React Compiler optimizations.
How often does this bug happen?
Every time
What version of React are you using?
18.2.0
What version of React Compiler are you using?
0.0.0-experimental-a1856f3-20260409