In this episode of the PodRocket podcast, host Paige Niedringhaus interviews Dominik Dorfmeister, a software engineer at Sentry and open-source maintainer, about the overuse and potential pitfalls of useCallback and useMemo in React.js. Dominik argues that while these hooks are intended to improve performance through memoization, they often add unnecessary complexity and become ineffective as codebases evolve. He suggests questioning their usage, especially in light of the upcoming React Compiler, which automates memoization. The discussion covers alternative approaches like the "latest ref pattern" and the experimental useEffectEvent hook, along with practical tips for code reviews and team guidelines to avoid over-optimization and maintain code readability.
Sign in to continue reading, translating and more.
Continue