▲ 1 r/reactjs
Unexpected react compiler output
Hello, I am trying to understand how the react compiler works and ran into a behavior that I don't quite understand.
In TableContainer1, data1 and data2 are cached using input1 and input2 respectively, which is what I expected.
But in TableContainer2, both data1 and data2 are re-computed when either input1 or input2 is changed.
It feels like some sort of trap. Why is it so?
Thank you
u/Breadfruit-Last — 20 hours ago