React.memouseMemouseCallbackPerformanceMemoization

React.memo, useMemo & useCallback

Master React's three memoization tools. Understand what each one caches, when to reach for them, and when they hurt more than they help — the nuance interviewers are looking for.

30 min read13 sections
01

Overview

React re-renders a component whenever its parent re-renders — even if the child's props haven't changed. In large apps, this cascading behavior creates unnecessary work: rebuilding Virtual DOM trees, running diffing, and sometimes touching the real DOM for zero visual change.

React gives you three memoization tools to short-circuit this waste: React.memo skips re-rendering an entire component if its props are the same, useMemo caches the result of an expensive calculation so it isn't recomputed every render, and useCallback caches a function reference so child components receiving it as a prop don't see a "new" function every time.

The key skill isn't knowing the API — it's knowing when to use each one and when memoization adds overhead without benefit. That nuance is exactly what interviewers test.

Why this matters

"How would you optimize a slow React component?" is one of the most common frontend interview questions. Understanding these three tools — and their trade-offs — is the foundation of every good answer.

1 / 13