useMemo and useCallback in practice

These hooks preserve identity between renders. Their value is in what depends on that identity, not in the caching itself.

Lesson 2.213m 41sAdvanced5.9k students

Lesson length

13:41

What this lesson covers

  • Memoise values that feed memoised children or effects
  • Get the dependency array right, every time
  • Skip memoisation when the computation is trivial

This lesson sits in Rendering Optimization, part of React Performance Engineering. It assumes what came before it and leads directly into the next lesson in the module.

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

Resources