Home / Learn React / Performance Techniques

Performance Techniques

Make apps feel fast: keep state low, split big components, virtualize long lists, lazy load code and memoize only where measurements show a need.

In shortMeasure first with the Profiler. Then fix the biggest problem: heavy rendering, huge lists, large bundles.

Theory in plain words

Where to look, in order1. Network and bundle size: compress images, code split2. Too much state high in the tree: move it down3. Long lists: virtualize4. Expensive calculations: useMemo or the compiler5. Child re-renders: React.memo + stable props
Where to look, in order

What it is

Performance work means reducing the work React and the browser must do: fewer renders, cheaper renders, less JavaScript and less data.

Why we use it

Slow typing, janky scrolling and long first loads make users leave. Search engines also measure loading speed.

How it works

Re-renders are normally fast. Problems come from very large lists, expensive calculations, state held too high, large bundles and slow networks.

Where it is used

  • Big tables, feeds, charts, dashboards, mobile devices
memo skips work when props are the sameTry it Yourself

Open the console panel: Row logs once at the start and not again when you click, because its props did not change.

Quick quiz

1. What should you do before optimizing?

2. For a list with thousands of rows use...

3. Best key for changing lists?

Common questions

What should you do before optimizing?

Measure with the Profiler. Find the real problem first.

Best key for changing lists?

a stable id. Stable unique ids.