Back to blog
#react#web-development#performance

A Practical Guide to React Performance

Most React performance problems come from a handful of recurring patterns. This guide covers the techniques that deliver the biggest wins with the least complexity.

By Rafael Costa1 min readEnglish
Share
A Practical Guide to React Performance

React is fast by default, until it isn't. The good news is that the vast majority of real-world performance issues trace back to a small set of patterns. Fix those, and you rarely need exotic optimizations.

Measure before you optimize

The first rule of performance work is to never guess. Use the React Profiler and the browser's performance panel to find what actually renders, and how often.

Premature optimization

Wrapping every component in memo and every value in useMemo adds complexity and can make things slower. Optimize the hot paths you have measured, not the ones you imagine.

Avoid unnecessary re-renders

A re-render isn't inherently bad, but cascading re-renders of expensive subtrees are. The most common culprit is passing a freshly-created object or function on every render.

tsx
// ❌ A new array + handler every render breaks memoized children
function ProductList({ products }) {
  return (
    <List
      items={products.filter((p) => p.inStock)}
      onSelect={(id) => track(id)}
    />
  );
}

// ✅ Stabilize derived data and callbacks
function ProductList({ products }) {
  const inStock = useMemo(
    () => products.filter((p) => p.inStock),
    [products],
  );
  const handleSelect = useCallback((id) => track(id), []);

  return <List items={inStock} onSelect={handleSelect} />;
}

Memoize the right things

React.memo, useMemo and useCallback are tools for keeping referential identity stable across renders. Reach for them when:

  • a child component is expensive to render, and
  • it receives props that would otherwise change identity every render.

Better still, let the React Compiler handle memoization for you. Adding it is a single dependency:

bash
npm install babel-plugin-react-compiler

Ship less JavaScript

The fastest code is the code you never send. Code-splitting and lazy loading keep the initial bundle small.

tsx
import { lazy, Suspense } from 'react';

const Editor = lazy(() => import('./Editor'));

export function Panel() {
  return (
    <Suspense fallback={<Spinner />}>
      <Editor />
    </Suspense>
  );
}

Move work to the server

With React Server Components, data fetching and heavy rendering can happen on the server, shipping only the resulting HTML and a minimal amount of client JS. The practical heuristic:

ConcernPrefer
Data fetchingServer Component
Static contentServer Component
Interactivity/stateClient Component ('use client')
Browser-only APIsClient Component

Optimize images and fonts

Images are usually the largest assets on a page. Use a real image pipeline (responsive sizes, modern formats, lazy loading) and load only the font weights you actually use.

The short version

Measure first. Cut re-renders on hot paths. Ship less JavaScript. Push work to the server. Optimize media. Do those five and you've handled 90% of real React performance problems.

#react#web-development#performance
Share this article
Rafael Costa

Written by

Rafael Costa

Software Engineer & Technical Writer

Rafael is a software engineer at Lusivision who writes about web development, cloud architecture and applied AI. He has spent over a decade shipping production software for companies across Europe and enjoys turning hard technical topics into clear, practical guides.

View all articles

Related articles

Migrating to Next.js 16: A Practical Upgrade Guide
EN
#web-development#performance

Migrating to Next.js 16: A Practical Upgrade Guide

Next.js 16 makes caching opt-in, turns params into promises, and swaps middleware for proxy.ts. Here is how to upgrade an App Router app without breaking it.

5 min read
Core Web Vitals in 2026: How to Finally Pass INP
EN
#web-development#performance

Core Web Vitals in 2026: How to Finally Pass INP

INP is the most failed Core Web Vital in 2026, and 43% of sites still miss it. Here is how to fix interactivity, LCP and CLS so Google can actually rank you.

4 min read

Newsletter

Stay in the loop

Occasional notes on software, design and what we're building. No spam — unsubscribe anytime.