Skip to content
Preptima
mediumConceptCodingMidSeniorStaff

You wrapped the component in React.memo and it still re-renders on every keystroke. Why?

React.memo still re-renders when shallow prop comparison fails because parents recreate objects, callbacks or children, or when context and local state update. Stabilise references with useMemo/useCallback only where it removes real render cost.

4 min readUpdated 2026-08-15

Answer

Short answer

React.memo compares props shallowly. If the parent creates a new object, callback or JSX child on every render, the memoized component still sees changed props. Context changes and the component's own state also bypass the prop comparison, so memo only helps after props are stable and render cost matters.

Was this answer helpful?

Likely follow-ups

  • Your memoised row takes an onSelect prop from a parent that re-renders often. What are the two ways to make that prop stable, and which is preferable?
  • Why does passing children to a memoised component defeat memo, and what would you do instead?
  • A list of 5,000 rows is slow even with every row memoised. What is the actual fix?
  • What does the React Compiler remove the need for, and what does it still not solve?

Related questions

Further reading

Related Topics