A React component running again is not automatically a performance problem. First measure a slow interaction, find which part of the tree is doing costly work, and identify what triggered the update. Fix unnecessary state and Effect patterns before adding targeted memoization.
What a React re-render means—and what it does not
React may call a component again because its parent rendered, its own state changed, or a context value it consumes changed. Rendering is the step where React calculates what the UI should look like; committing is the step where React applies necessary changes to the DOM. A render pass does not necessarily produce a visible change. See React’s explanation of render and commit.
As an Amazon Associate I earn from qualifying purchases.
The useful question is not “How do I stop all re-renders?” It is “Does this interaction spend meaningful time on work that could be avoided?” A component can render often without creating a user-visible delay, while a costly calculation or large subtree can make a particular update feel slow.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteMeasure the slow interaction before changing code
Use React Developer Tools Profiler or React’s <Profiler> API to inspect the interaction that feels slow. The Profiler reports actualDuration, the time spent rendering the profiled subtree for that update, and baseDuration, an estimate of how long the subtree would take without optimizations. Compare measurements for the same interaction before and after a change; the values are most useful in that consistent context. Profiling adds overhead and is disabled in production by default. Production profiling requires a special profiling build. See the Profiler reference.
#1 Best Overall
- Reproduce one slow interaction reliably, such as opening a panel or typing into a search field.
- Record a profile and locate the subtree with expensive rendering work.
- Work backward from that component: did its state change, did a parent render, did consumed context change, or did an Effect schedule another update?
- Make one structural or memoization change, then profile the same interaction again.
A render count alone is not a diagnosis. Look for costly work and the update source, rather than treating every component invocation as a defect.
Fix update patterns before adding memoization
Keep transient state close to where it is used
State for an interaction—such as whether a small menu is open—usually belongs near the components that need it. When that state lives high in the tree, changing it can cause a wider subtree to render. Moving it closer can reduce the amount of the tree that responds.
Do not store values you can calculate during render
If a value can be derived from current props or state, calculate it during rendering instead of copying it into separate state with an Effect. An Effect that sets state after rendering can trigger an avoidable follow-up update. React’s guide, You Might Not Need an Effect, explains when render-time calculation is preferable.
Pass children through wrapper components where appropriate
If a wrapper only controls layout or behavior, passing its contents as JSX children can help keep those contents from being recreated as part of the wrapper’s own render. This is a structural option to consider when profiling shows the wrapper’s updates are causing unnecessary work downstream.
Rank #3
Use memoization at a measured boundary
memo can skip some parent-triggered renders
memo lets React skip rendering a component when its props compare equal to the previous props. By default, React compares each prop using shallow reference equality. A newly created object, array, or function therefore counts as changed even if its contents or behavior seem equivalent. A memoized component can still render when its own state changes or when a context it consumes changes. Memoization is an optimization, not a guarantee. See React’s memo reference.
Stabilize only the values a memo boundary needs
useMemo caches the result of a calculation, and useCallback caches a function identity while their dependencies remain equal under Object.is. They can help when a measured memoized child receives an object, value, or callback whose changing identity defeats the memo boundary. Prefer simpler props when possible, and do not add these Hooks everywhere by default.
Rank #4
React’s useMemo reference puts the rule plainly: “You should only rely on useMemo as a performance optimization. If your code doesn’t work without it, find the underlying problem and fix it first. Then you may add useMemo to improve performance.” The same measured, targeted approach applies to useCallback.
Consider React Compiler if the project supports it
React Compiler can automate many memoization optimizations when it is enabled and integrated into the project’s build. It targets cascading re-renders and expensive calculations in components and Hooks. Compiler adoption depends partly on build integration, codebase health, and following the Rules of React; it is not an automatic switch available in every project. Read the current React Compiler introduction for its integration guidance.
Best Value
During adoption, check what the compiler already optimizes. Leave existing manual memoization in place initially, or remove it only after careful testing. Re-profile the same interaction to confirm that a compiler or code change actually reduces work.
Choose the fix that matches the cause
| Approach | Use it when | Check before choosing |
|---|---|---|
| Restructure state or Effects | The update comes from broad state placement, redundant derived state, or an Effect that schedules an avoidable update. | Can the state move closer to its consumers, or can the value be calculated during render? |
| Manual memoization | A profile identifies an expensive child that rerenders despite unchanged semantic inputs. | Are its props stable? Would simpler props avoid the need for useMemo or useCallback? |
| React Compiler | The project can enable and integrate the compiler, and the codebase follows React’s rules. | What does the compiler already optimize, and does the same measured interaction improve? |
In every case, verify the result with the same interaction and profile. If the work was not costly, or the change makes the code harder to reason about without improving the measurement, it is not a useful performance fix.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →




