Community JavaScript Snippet

When `memo` Actually Stops a Re-render (and When It Does Not)

I once added React.memo everywhere and renders barely changed. Memo only works under specific conditions, and outside those it is dead weight. Three accordions on the trap and the fix.

When `memo` Actually Stops a Re-render (and When It Does Not)

I once added React.memo everywhere and renders barely changed. Memo only works under specific conditions, and outside those it is dead weight. Three accordions on the trap and the fix.

JavaScript
Frontend
3 snippets
react
hooks
memoization
performance-optimization
ananyaadeyemi

By @ananyaadeyemi

January 8, 2026

·

Updated May 18, 2026

978 views

7

4.2 (12)

This is the case the React docs imply when they introduce memo: the parent re-renders, the child receives the same primitive props, the shallow comparison hits, the child is skipped. The render counter at the bottom is the load-bearing thing to look at. Three parent renders produced one child render, two parent renders with 'Ada' then one with 'Linus' produced one more. If your memo'd components are this shape, memo is doing exactly what you expect. The trick is that almost no real component is this shape, which is what the next accordion is about.