useCallback
useCallback memoizes a function definition between re-renders. It returns the same function reference as long as its dependencies haven't changed. It's essentially useMemo(() => fn, deps).
useCallback is a name badge at a conference — 'Hi, I'm the same handleClick as last time' — so the bouncer (React.memo) lets you through without re-checking.
The primary use case is preventing unnecessary re-renders of child components wrapped in React.memo. Without useCallback, a parent re-render creates a new function reference each time, which breaks the shallow prop comparison in React.memo. useCallback is also needed when a function is used as a dependency in useEffect — without it, the effect would re-run on every render because the function reference changes.
useCallback doesn't prevent the function from being created — JavaScript still creates the closure on every render. It just returns the old reference if deps haven't changed. The real savings come downstream: a stable reference means React.memo children skip rendering, and effects with that dependency don't re-fire. In React 19, the compiler can auto-memoize callbacks, making useCallback optional. Until then, the rule of thumb is: only use useCallback when the function is passed to a memoized child or used as an effect dependency.
useCallback returns a stable function reference between renders when dependencies haven't changed. I use it to prevent child components wrapped in React.memo from re-rendering unnecessarily, and to stabilize function dependencies in useEffect. It doesn't avoid creating the function — it just reuses the old reference.
Wrapping every function in useCallback without a React.memo child or effect dependency is pure overhead — you're paying for dependency comparison with zero benefit.