Why is wrapping every handler in useCallback a mistake?
Because useCallback adds overhead. If the handler is used only in the same component, or the child using it is not memoized, the stable reference provides no benefit. Measure first and use it only where there is a real re-render problem.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in useCallback in React Explained: Avoiding Unnecessary Re-renders
useCallback takes a function and a dependency array and returns the same function reference across renders unless a dependency changes. Without it, a new function is created on every render, which can cause unnecessary re-renders.
When you pass a function as a prop to a child wrapped in React.memo. The stable reference prevents the child from re-rendering just because the parent created a new function on every render.
No. For functions used only inside the same component, the new reference is fine and useCallback adds overhead for no benefit. Use it only when passing to a memoized child or for handlers used in effects.
Still have questions?
Browse all our FAQs or reach out to our support team
