React Performance Optimization: Techniques Every Frontend Developer Should Know
Performance is not a feature — it's a requirement. In a market where users abandon sites that take longer than 3 seconds to load, frontend developers must treat performance as a first-class concern.
Having spent 3+ years building production React applications as a frontend developer in Ahmedabad, I've seen firsthand how small performance wins compound into massive user experience gains.
1. Master React.memo and useMemo
The most common performance bottleneck in React apps is unnecessary re-renders. React.memo prevents a component from re-rendering when its props haven't changed:
const ExpensiveList = React.memo(({ items }: { items: Item[] }) => {
return items.map(item => <ListItem key={item.id} {...item} />);
});
Pair it with useMemo for expensive computations and useCallback for stable function references passed to memoized children.
2. Code Splitting with React.lazy
Route-based code splitting is the single highest-ROI performance optimisation you can make. Split your bundle at route boundaries:
const Dashboard = React.lazy(() => import('./pages/Dashboard'));
const Settings = React.lazy(() => import('./pages/Settings'));
function App() {
return (
<Suspense fallback={<LoadingSpinner />}>
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/settings" element={<Settings />} />
</Routes>
</Suspense>
);
}
On a recent e-commerce project, code splitting reduced the initial JavaScript payload by 47% and improved Time to Interactive by 1.8 seconds.
3. Optimise Images and Fonts
Images typically account for 60-65% of page weight. Use next/image (Next.js) or manual <picture> elements with WebP/AVIF formats, lazy loading, and proper sizing.
For fonts, use font-display: swap and subset to only the characters you need. On a portfolio site I built with SvelteKit, font subsetting alone saved 120KB.
4. Monitor Core Web Vitals
Set up real-user monitoring (RUM) with the web-vitals library. Track LCP, FID/INP, and CLS in production:
import { onLCP, onINP, onCLS } from 'web-vitals';
onCLS(console.log);
onINP(console.log);
onLCP(console.log);
At SolePoint Solutions, we track Core Web Vitals across all client projects. The data drives our optimisation backlog — if LCP exceeds 2.5s, it becomes a sprint priority.
Key Takeaways
- Memoization is a scalpel, not a hammer — only memoize when profiling shows it's needed
- Code splitting at route boundaries is the easiest performance win
- Image optimisation alone can cut page weight by 40-60%
- Measure before you optimise — always start with Lighthouse or WebPageTest
Performance optimisation is an ongoing process, not a one-time task. Build a culture of measurement, and the wins will follow.
Written by Bhavya Panchal — Frontend Developer & UI Engineer
WORK WITH ME