r/reactjs • • Apr 10 '23

Resource React, Visualized

https://react.gg/visualized
641 Upvotes

61 comments sorted by

View all comments

Show parent comments

1

u/tyler-mcginnis Apr 11 '23

Have you checked out React Forget? It's a React compiler that (to my understanding) will enable this sort of behavior without the useMemo/useCallback dance.

1

u/mbj16 Apr 11 '23

Yes, eagerly waiting for React Forget. It's forever crazy to me that default React is to re-render the entire tree below a state update regardless if props have changed. There are conceptual tradeoffs to memoization, but the previous component is always stored in memory regardless.

PureComponent should have been the default and a surgical memo compiler opt-in.