React Performance Checklist
A practical React performance checklist: measure first, fix data flow, then memo, virtualize, and split code.
- react
- react-performance
Performance work without a checklist becomes random useMemo. Use this order — measure, structure, then micro-optimize.
1. Measure
- React DevTools Profiler for component time.
- Browser Performance panel for long tasks.
- Network for JS weight and waterfalls.
- Field metrics (INP, LCP) for real users.
No number, no “optimization.”
2. Fix structure before memo
- Colocate state — high-churn state should not live above expensive pure trees (state colocation).
- Composition — pass children so parents re-rendering do not recreate heavy subtrees unnecessarily.
- Split context — avoid mega-providers (context pitfalls).
- Keys — wrong keys remount and thrash (keys).
- Derived data — compute in render; do not effect-sync (derived state).
3. Concurrent scheduling
- useTransition / useDeferredValue for expensive UI behind snappy inputs.
function FilterPage({ rows }) {
const [text, setText] = useState('');
const [query, setQuery] = useState('');
const [isPending, startTransition] = useTransition();
return (
<>
<input
value={text}
onChange={(e) => {
const next = e.target.value;
setText(next);
startTransition(() => setQuery(next));
}}
aria-label="Filter"
/>
{isPending && <span aria-live="polite">Updating…</span>}
<HeavyList rows={rows} query={query} />
</>
);
}
Keep the input urgent; mark the list update as a transition so typing stays responsive.
4. Targeted memoization
memoon proven heavy pure children.useMemo/useCallbackwhen referential stability is required by memo/deps — not everywhere.
5. Lists and code size
- Virtualize huge lists (virtualization).
- Lazy-load heavy routes/widgets (React.lazy).
- Prefer Server Components for non-interactive UI in RSC apps.
6. Effects and subscriptions
- Abort fetches; unsubscribe listeners.
- Do not setState in loops.
- Prefer event handlers over effect chains.
Anti-checklist (do not)
- Memo every component “for performance.”
flushSyncin hot paths.- Deep compare everything with custom memo.
- Optimize before a profile.
Interview out-loud
“I measure with the profiler, fix state ownership and context scope first, then use transitions for heavy updates, memo only where props are stable and cost is proven, and virtualize or code-split large surfaces. Structure beats decoration.”
Related on this site
Further reading
Edge cases worth rehearsing
Interviewers and production incidents cluster around the same edges: first render versus update, empty and loading states, Strict Mode double setup, concurrent interruptions, and what happens when identity (key, route params, user id) changes mid-edit. Walk one concrete user journey end-to-end — open, edit, navigate away, come back — and say which state survives.
Prefer fixing data flow and ownership before reaching for memoization or micro-optimizations. Prefer event handlers over effects when a user action is the trigger. Prefer deriving values during render over mirroring props into state. Prefer stable list keys from business ids. Measure with the profiler when performance is the claim.
When you cite an API, mention one failure mode: abort on unmount, serializable props across server/client boundaries, focus restoration for dialogs, or cache invalidation after a mutation. Specific beats generic every time.
Edge cases worth rehearsing
Interviewers and production incidents cluster around the same edges: first render versus update, empty and loading states, Strict Mode double setup, concurrent interruptions, and what happens when identity (key, route params, user id) changes mid-edit. Walk one concrete user journey end-to-end — open, edit, navigate away, come back — and say which state survives.
Prefer fixing data flow and ownership before reaching for memoization or micro-optimizations. Prefer event handlers over effects when a user action is the trigger. Prefer deriving values during render over mirroring props into state. Prefer stable list keys from business ids. Measure with the profiler when performance is the claim.
When you cite an API, mention one failure mode: abort on unmount, serializable props across server/client boundaries, focus restoration for dialogs, or cache invalidation after a mutation. Specific beats generic every time.
Related guides
- Accessibility Patterns in ReactPractical React a11y: labels, focus management, keyboard, live regions, and composition patterns that stay accessible.
- Avoid Prop Drilling with CompositionStop threading props through intermediates: children slots, inversion of control, and when context is the right escape hatch.
- Batching State UpdatesHow React 18+ batches setState in events, timeouts, and promises: when updates flush and why double setState still works.
- Children Prop PatternsUsing children and slot props for flexible APIs: wrappers, compound components, and when to prefer explicit props.
- Client Component BoundariesWhere to put use client: push interactivity to leaves, serializable props, and children as server slots.