MohitDecodes
Back to blogsReact

Why Your React Components Re-render Too Often (and How to Fix It)

August 8, 2026 · 7 min read

A component re-renders for one of four reasons: its own state changed, its parent re-rendered, a context it consumes changed, or one of its hooks triggered an update. The one that surprises people most is the second one — a parent re-rendering re-renders every child underneath it by default, whether or not that child's props actually changed.

The prop-reference trap

This is the single most common cause of "unnecessary" re-renders. React compares props with `===`, not deep equality. An object or array that looks identical is still a *new reference* every time it's created inline during a render.

// Every render creates a brand-new object and function —
// even if nothing about them actually changed
function Parent() {
  return <Child style={{ color: "red" }} onClick={() => doThing()} />;
}

If `Child` is wrapped in `React.memo`, this still re-renders every time, because `{ color: "red" }` and `() => doThing()` are new objects on every call to `Parent`, so the memo comparison sees "different props" even though nothing meaningful changed.

The three fixes, in order of how often you actually need them

  • React.memo — wrap a component so it skips re-rendering when its props are shallow-equal to last time. Use this first, on components that render often but change rarely (list items are the classic case).
  • useCallback — memoize a function reference so it doesn't count as "new" every render. Only useful when that function is passed to a memoized child — using it everywhere "just in case" adds overhead for no benefit.
  • useMemo — memoize an object, array, or expensive computation so it keeps the same reference (or skips recomputing) between renders when its dependencies haven't changed.

The mistake I see most often is applying all three everywhere reflexively. Memoization has a cost too — it's a comparison on every render, plus more code to reason about. It's worth it for a component that renders 500 list rows; it's noise on a page with a header and a form.

The fix that beats all three: don't lift state you don't have to

Before reaching for `memo`/`useCallback`/`useMemo`, check whether the state causing the re-render actually needs to live where it lives. State that's only used inside one small component but got lifted "to be safe" drags the whole subtree above it into re-rendering on every keystroke. Moving state back down to where it's actually used is usually a bigger win than memoizing your way around the symptom.