ReactAdvanced#performance

How do you optimise performance in a React app?

Measure with the Profiler first, then apply targeted fixes: stable keys, memoized expensive children, virtualised long lists, code splitting, moving state closer to where it is used, and avoiding new object props in hot paths.

Example
const Row = React.memo(RowBase);
const data = useMemo(() => transform(raw), [raw]);
// virtualise 10k rows instead of rendering them all

Related Questions

1
ReactAdvanced#ssr#seo

What is the difference between client-side and server-side rendering?

Open
2
ReactAdvanced#ssr

What is hydration?

Open
3
ReactIntermediate#forms

How do you handle forms and validation in React?

Open