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.
Theory in plain words
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
Open the console panel: Row logs once at the start and not again when you click, because its props did not change.
- Use stable, unique
keyvalues (ids, not array index) for lists that change. - Compress and size images, use
loading="lazy". - Analyze the bundle with
vite-bundle-visualizerand drop heavy libraries you barely use. - Debounce search inputs and use
useDeferredValuefor heavy filtered lists.
Quick quiz
1. What should you do before optimizing?
Find the real problem first.
2. For a list with thousands of rows use...
Render only visible rows.
3. Best key for changing lists?
Stable unique ids.
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.