Home
← All questions

React.memo, useMemo, and when optimization backfires

HardPremiumReact

Asked at Meta · Google · Netflix

React interview practice: Prevent unnecessary re-renders without premature optimization

Answer

React.memo(Component) skips re-render if props are shallow-equal.
useMemo / useCallback stabilize references so memoized children don't invalidate.

When it helps: expensive pure components in large lists, frequently re-rendering parents with stable data, design-system primitives.

When it hurts: cheap components, unstable inline objects/functions defeating memo, added complexity without profiling evidence.

Always profile first (React DevTools Profiler, why-did-you-render).

Premium question

Unlock the full model answer with Mentoxis Premium.

Unlock with Premium