What you'll learn
- Paths for context blast, unstable callbacks, expensive children and Compiler-first apps
- Match Profiler symptoms to the right fix
- Five practical rules with before and after code
- When memoization helps and when it is noise
React re-renders a component when state, props, or context changes. That behavior is how React keeps UI consistent with data.
Most re-renders are fine. The ones that hurt repeatedly run expensive work, or force large subtrees to repaint when nothing meaningful changed for that part of the UI.
Use the path picker when you know your situation. Use the symptom matcher when the Profiler shows a confusing commit. The rules below keep the code patterns.
Impact: smoother interactions and lower CPU usage in complex UIs

Pick a re-render fix path
Try it: re-render fix path
Pick the situation you are in. You get an ordered approach, why it fits, and a first-week plan.
Your path
Split context before wrapping every child in memo
One mega context re-renders every consumer. Splitting values by update rate usually beats memoizing the whole tree.
- useContext
Subscribe only to the slice you need.
- React DevTools Profiler
Confirm which consumers commit on each update.
- State Management
Move hot UI state out of shared context when it belongs local.
- React.memo
Memo leaves only after the blast radius is small.
First week
Find one context that mixes auth, theme and prefs. Split theme out. Re-profile one screen that used to flash on login.
The rules below keep the code patterns. The path above is how you choose which rule to apply first.
Checkpoint
A mega context mixes auth, theme and prefs. Theme-only consumers re-render on login. What first?
Pick an answer, or press A, B, C on your keyboard.
Match a re-render symptom

Try it: match a re-render symptom
Choose what you see in the Profiler. The matcher points to a primary fix and an optional alternate.
The symptom
A child commits whenever the parent renders, even when its visible props look unchanged.
Start here
Why parent state causes child re-renderParent state schedules a render pass. Children render unless memo and stable props skip them.
Most re-renders are fine. Fix the ones that burn CPU or jank interactions.
Key takeaway
Measure first. Stabilize props before trusting memo. Split hot context before wrapping the tree.
Rule 1: Lazy state initialization
If initial state setup is expensive, initialize lazily. For more loop and object patterns around this, see JavaScript Performance Patterns.
With lazy initialization, React calls the initializer only for the initial state setup, not during subsequent renders.
Rule 2: Stabilize callback references

A memoized child still re-renders if it receives a new function reference every render.
React.memo only helps when props are stable references.
Rule 3: Memoize expensive derivations
If you repeatedly sort or filter big collections, compute once per dependency change.
Rule of thumb: memoize only if a computation costs more than about 1ms and profiling confirms it.
Rule 4: Stable object and array literals in props
Object and array literals create new references on every render.
Stable references reduce avoidable memoized-child updates. Deeper object-creation patterns live in JavaScript Performance Patterns.
Rule 5: Split context to avoid blast radius

A giant context causes broad re-renders because any value change updates all consumers.
This limits re-render blast radius: auth changes should not repaint theme-only consumers.
Checkpoint
You wrapped a child in React.memo and it still commits every parent render. What is the usual cause?
Pick an answer, or press A, B, C on your keyboard.
React Compiler note (React 19)
If you are on React 19 with the React Compiler enabled, rules 3 and 4 are often automated by compile-time memoization. Rules 1, 2, and 5 still apply and remain important architectural practices.
When NOT to optimize
Do not optimize by default "just in case." Start with the React DevTools Profiler and production-like scenarios, then optimize the top offenders. Premature optimization adds complexity, increases bug risk, and can make code harder for teams to maintain.
Prefer this order:
- Measure first
- Optimize targeted bottlenecks
- Re-measure to confirm impact
The key habit
Profile before memo. Split context before wrapping the tree. Stabilize props before blaming React.memo.
Re-render checklist
- I profiled a production-like scenario before adding memo
- Expensive initial state uses a lazy useState initializer
- Memoized children get stable callbacks and object props
- Expensive derivations use useMemo only when measured
- Hot context values are split by update rate
- I know whether the React Compiler covers my stack
Further reading
- Proficiency with Hooks
- Why Parent State Causes Child Re-render
- JavaScript Performance Patterns
- React Performance Optimization
- Eliminating Async Waterfalls
- State Management
Conclusion
Re-renders are not the enemy. Unmeasured memo is. Fix identity and blast radius first, then cache the work that still shows up in the Profiler.
The key takeaway
Most re-renders are fine. Fix the ones that burn CPU or jank interactions, after you measure them.
Check your understanding
A mega context re-renders theme-only consumers on login. What should you do first?
Pick an answer, or press A, B, C on your keyboard.
Recap
What to remember from this article
Sections read
0
Questions
0
none answered yet
Quiz
0
not taken yet
Up next: Eliminating Async Waterfalls · 4 min
Continue