liveBook · Manning

useMemo

useMemo is a React Hook that caches a calculated value between renders and recomputes it when specified dependencies change.

How 4 Manning books explain it

React in Depth

useMemo is a React hook that caches the result of a calculation between renders until its dependencies change.

How it is used
Uses useMemo to avoid repeated calculations and preserve prop identity during React rendering.
How deep it goes
Explains the calculation-and-dependency contract through implementations, but does not detail React’s cache internals.
Examples
Demonstrates employee filtering, cached to-do JSX, and a stable array prop for a memoized child.
What you can do after
Apply it via React’s useMemo hook to cache derived values or stabilize props, while weighing measured benefit against overhead.

Read how React in Depth explains useMemo →

Acing the Frontend Interview

useMemo is a React Hook that memoizes the result of a calculation between renders until specified dependencies change.

How it is used
Targets expensive calculations and unnecessary rendering work during React performance tuning.
How deep it goes
Explains targeted memoization and profiling workflow but does not detail hook syntax or dependency semantics.
Examples
Uses Profiler views, Components-tab inspection, render highlighting, and Profiler API measurements to investigate optimization targets.
What you can do after
Diagnose/debug with React DevTools Profiler, apply targeted memoization, and retest rendering performance.

Read how Acing the Frontend Interview explains useMemo →

React Quickly, Second Edition

useMemo is a React Hook that memoizes a calculated value and reuses it across renders until its dependencies change.

How it is used
Avoids recalculating values on repeated renders when their dependencies have not changed.
How deep it goes
Explains dependency-triggered recalculation and illustrates an empty dependency array with a generated ID.
Examples
Uses an expensive password hash and a gallery image's generated ID to demonstrate memoized values.
What you can do after
Apply useMemo to reuse a generated ID across renders or recalculate a value only when dependencies change.

Read how React Quickly, Second Edition explains useMemo →

React Hooks in Action: With Suspense and Concurrent Mode

useMemo is a React Hook that memoizes a calculated value and recomputes it when specified dependencies change.

How it is used
Uses memoization to reduce unnecessary expensive calculations during React rendering and protect interactive UI responsiveness.
How deep it goes
Explains calculation functions, dependency comparison, cache caveats, and a bookings-grid implementation, while stopping short of React internals.
Examples
Demonstrates expensive anagram generation and memoized booking-grid generation based on a selected bookable and week.
What you can do after
Apply useMemo to wrap an expensive calculation and regenerate it when named dependencies change.

Read how React Hooks in Action: With Suspense and Concurrent Mode explains useMemo →

Also covered in

What to know first

Related concepts

Questions about useMemo

What is useMemo?

useMemo is a React Hook that caches a calculated value between renders and recomputes it when specified dependencies change.

Which Manning books explain useMemo?

React in Depth, Acing the Frontend Interview, React Quickly, Second Edition and React Hooks in Action: With Suspense and Concurrent Mode.

What should I know before learning useMemo?

Manning books that teach useMemo usually introduce component, dependency array, JavaScript and rendering first.

What is useMemo a kind of?

useMemo is a kind of React hook. A React Hook is a function-based API that enables function components to access state, effects, context, and other React capabilities.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.