Lesson 2.2

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.

Duration
14m
Level
Advanced
Students
5.9k 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

Resources

React documentation

The official reference for the tools used in this lesson.