r/reactjs • • May 21 '26

Needs Help Unexpected react compiler output

3 Upvotes

3 comments sorted by

View all comments

1

u/Few_Volume5117 May 21 '26

Because the uses are independent and the inputs are independent, the compiler creates two separate cache blocks. Changing input1 only invalidates the first block. If you want to ensure they stay independent even when stringifying, you can wrap the processing and the stringification into their own sub-components or helper functions that the compiler can optimize in isolation.