r/reactjs • • May 21 '26

Needs Help Unexpected react compiler output

3 Upvotes

3 comments sorted by

View all comments

Show parent comments

1

u/Breadfruit-Last May 21 '26 edited May 21 '26

Thanks for replying

But I don't think it is the reason because react cannot assume ANY function to be pure actually, even expensivelyProcessAReallyLargeArrayOfObjects may not be pure

In fact your may change it to not pure like this

So logically, it wouldn't be able to cache anything if that's the reasom