liveBook · Manning

useMemo

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

How 3 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 →

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 →

Related concepts

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.