brundolfon Hacker News • Recommends
On “Not using useCallback is premature optimization”
For those pushing back, I wanted to share this talk given at a recent React Conf: link to this video The idea (still just an internal prototype) is that one day your compiler might automatically memoize all React components and intermediate values for you. It obviously would be great to skip all the syntax noise, as well as the linter-enforced rules around correctly maintaining dependency arrays, etc. But I think a big takeaway from this talk is that the React team sees memoizing as the norm . It is something to do by default , so much so that it may happen without your intervention one day. Immutability and value identity-based comparison are core to React. Violating these is the only way memoization…