Skipping an expensive recalculation when nothing it depends on has changed.
useMemo caches the result of a computation between renders, only recalculating it when a value in its dependency array changes. It exists specifically for genuinely expensive work — filtering or sorting a large list, heavy derived calculations — where recomputing on every render (including renders triggered by unrelated state) would be wasteful.
The common mistake is reaching for useMemo on cheap computations, where the overhead of comparing dependencies and managing the cache can outweigh whatever it saves. It's also worth knowing that useMemo is explicitly a performance hint, not a correctness guarantee — React is allowed to discard a memoized value and recompute it under certain conditions (like memory pressure), so code should never rely on useMemo to avoid running a computation for correctness reasons, only for performance.
What you'll walk away knowing