LESSON 2.2
useMemo and useCallback in practice
Learn key techniques and workflows in React Performance Engineering.
13m
advanced
5,887 students
Overview
These hooks preserve identity between renders. Their value is in what depends on that identity, not in the caching itself.
In this lesson you will:
- Memoise values that feed memoised children or effects
- Get the dependency array right, every time
- Skip memoisation when the computation is trivial
Pro Tip
If nothing downstream depends on the identity of a value, memoising it buys you nothing.