r/programming • • Mar 29 '22

React 18 released!

https://reactjs.org/blog/2022/03/29/react-v18.html
749 Upvotes

183 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Mar 30 '22

[deleted]

2

u/Nysor Mar 30 '22

I'm not sure if wrapping intermediary callbacks and non-primitive variables in a memo is best practice, but it's definitely one solution.

It's worth noting the memory used is going to be in-browser memory. In my experience, the usage from all the useCallback/useMemo/useEffect dependencies arrays is not noticeable even at scale. See here for more info about the potential future compiler.