Skip to content

Performance & Patterns

React is fast by default. Almost every real performance problem comes down to one of two things: rendering too often (components re-render when nothing they show has changed) or rendering too much (a single render does expensive work). The fixes are structural — keep state low, stop re-render propagation where it does not matter, and only reach for memoization once a profiler shows you need it.

This module also covers the patterns that make components composable — because a well-composed component tree is usually a fast one.

LessonWhat you’ll learn
Rendering performanceWhy components re-render, and how to render less
Memoization in practiceuseMemo / useCallback / React.memo — and the compiler
Composition patternsCompound components, render props, controlled vs uncontrolled
Refs, portals & escape hatchesWhen to step outside the declarative model
flowchart LR
  slow["Something feels slow"] --> profile["Profile it
(React DevTools)"]
  profile --> find["Find the actual cause
(too many renders? too much work?)"]
  find --> fix["Fix that specific cause"]
  fix -. avoid .-> guess["Sprinkling memo everywhere
by guessing"]
Measure before you memoize

The most common mistake is memoizing by reflex — wrapping everything in useMemo/useCallback before knowing whether it helps. Memoization has its own cost (memory, comparison, complexity), and the React Compiler now automates most of it. Profile first, fix the real cause, and let the compiler handle the rest.

What are the two root causes of most React performance problems?
What should you do before adding memoization?
What increasingly handles manual memoization for you?