What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To skip a child component’s render when its parent updates, wrap the child in memo and make sure its props are unchanged. If a parent creates a new function, object, or array on each render, that new reference can defeat the memoization; use useCallback or useMemo only when profiling shows the work is worth optimizing. Memoization does not stop updates caused by the child’s own state or by context it reads.
First check whether the render is a problem
A render is not automatically a performance defect. Start by reproducing the slow interaction and inspecting component work with React Developer Tools. Optimize when profiling identifies expensive work or a noticeable delay, rather than adding memoization to every component. React describes memo, useMemo, and useCallback as performance optimizations, not correctness requirements: React memo, React useMemo, and React useCallback.
As an Amazon Associate I earn from qualifying purchases.
Use memo for a child with unchanged props
memo returns a memoized component. When its parent renders, React will usually skip rendering that child if each prop is equal to its previous value. By default, React compares each prop with Object.is. This is not a guarantee that the component will never render; it is a way to avoid some parent-driven renders when the inputs have not changed. See the React memo reference.
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 minuteimport { memo } from 'react';
const Results = memo(function Results({ items, onSelect }) {
return items.map(item => (
<button key={item.id} onClick={() => onSelect(item)}>
{item.name}
</button>
));
});
This boundary can help when Results is costly to render and receives the same items and onSelect references across an unrelated parent update. If either prop changes, React has a reason to render the child again.
#1 Best Overall
Keep function and value props stable when needed
Objects, arrays, and functions are compared by identity, not by whether their contents or behavior look equivalent. An inline callback or object literal creates a new reference each time its parent renders, so a memoized child sees a changed prop.
Cache a callback with useCallback
useCallback reuses a function reference until one of its dependencies changes. Include every reactive value the callback uses in its dependency list; leaving one out to preserve the cache can make the callback use stale values. Read the React useCallback reference for the dependency rules.
const handleSelect = useCallback(item => {
console.log('Selected', item.id);
}, []);
Cache a calculated value with useMemo
useMemo reuses a calculated value while its dependencies remain equal. It is useful here when the value passed to a memoized child would otherwise be freshly created on every parent render, or when the calculation itself is costly. Include all reactive inputs in the dependency list. See the React useMemo reference.
Free tools Windows power users keep installed
One-click scans. No signup required.
const visibleItems = useMemo(
() => items.filter(item =>
item.name.toLowerCase().includes(query.toLowerCase())
),
[items, query]
);
Put the pieces together
import { memo, useCallback, useMemo, useState } from 'react';
const Results = memo(function Results({ items, onSelect }) {
return items.map(item => (
<button key={item.id} onClick={() => onSelect(item)}>
{item.name}
</button>
));
});
function SearchPage({ items }) {
const [query, setQuery] = useState('');
const visibleItems = useMemo(
() => items.filter(item =>
item.name.toLowerCase().includes(query.toLowerCase())
),
[items, query]
);
const handleSelect = useCallback(item => {
console.log('Selected', item.id);
}, []);
return (
<>
<input value={query} onChange={event => setQuery(event.target.value)} />
<Results items={visibleItems} onSelect={handleSelect} />
</>
);
}
When query changes, the filtered results change, so Results should render to show the new list. The memoization is relevant to unrelated parent updates when both child props remain stable; this example is an explanatory pattern, not a measured performance result.
Rank #3
Know which updates memoization cannot stop
The child’s own state changes
memo does not prevent a component from rendering when its own state changes. It only helps with some renders caused by its parent.
Context read by the child changes
A component that reads context still updates when that context value changes, even if it is wrapped in memo. Context consumers respond to provider value changes; memoization does not shield them. One option is to read context in an outer component and pass only the needed value to a memoized inner component. See the React useContext reference and the memo reference.
Rank #4
A dependency changes
useCallback and useMemo refresh their cached result when a listed dependency changes under Object.is. That is expected: if an input changes, a derived value or callback may need to change too. Do not omit reactive dependencies solely to make a reference appear stable.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Fix the source of excess work before adding more caches
- Reduce unnecessary state propagation: keep transient state close to the component that uses it, so unrelated parts of the tree do not need to respond to it.
- Use composition where it fits: a visual wrapper can accept JSX as children, allowing the wrapper’s own state changes without unnecessarily recreating the wrapped content.
- Remove avoidable update chains: reconsider Effects that set state when the same result can be derived during rendering or managed more directly.
- Simplify changing props: if a memoized child receives an always-new object or array, consider passing simpler props or stabilizing the value when profiling supports the change.
These structural approaches can be clearer than accumulating memoization. React’s guidance on useCallback and useMemo cautions that most calls provide no benefit unless they support a memoized child, a Hook dependency, or a slow calculation. A single always-new value can also defeat a memo boundary.
Best Value
Check whether React Compiler is active
React Compiler can automatically handle many memoization cases when it is installed, configured, and compiling the component. Do not assume it is enabled just because a project uses React; confirm the project’s compiler setup and scope in the React Compiler documentation. Whether manual memoization is useful depends on that setup and on the actual render cost.
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.




