TLDR Web Dev · ARTICLES & TUTORIALS

THE USELESS USECALLBACK

tkdodo.eu5 min read

Summary from the TLDR Web Dev newsletter

`useCallback` and `useMemo` are often misused, leading to unnecessary complexity and overhead without actual performance gains. This article goes over scenarios where memoization is pointless, such as when passing props to non-memoized components or using props directly as dependencies within `useCallback` or `useEffect`. A real-world example is shown from the Sentry codebase to illustrate how seemingly memoized values can be invalidated by non-memoized dependencies.