Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wrap a child in memo to let it skip a parent-triggered render when its props have not changed. If the parent recreates a function, object, or array prop on every render, stabilize that value with useCallback or useMemo—but only when profiling shows the extra work matters. These tools are performance optimizations, not guarantees: a child’s own state and context changes can still make it render.

First, determine whether the rerender is a problem

A render is not automatically a performance issue. Before changing the component tree, use React Developer Tools to profile the interaction that feels slow and identify which component work is costly. Memoization adds complexity, so it is most useful when it addresses a measured cost rather than a render count in isolation.

Keep rendering pure: given the same inputs, a component should produce the same output without causing side effects. Also check whether an unnecessary Effect is updating state and creating an avoidable chain of renders. Fixing the state flow may be clearer than memoizing around it.

Use memo when a child receives unchanged props

memo creates a memoized component. React will usually skip a render caused by the parent when every prop compares equal to its previous value. By default, React compares each prop with Object.is. The React documentation emphasizes that memo is a performance optimization, not a guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

For example, a list component can be memoized when its inputs remain the same during unrelated parent updates:

import { 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 helps only if the props remain equal. It does not prevent updates caused by the child’s own state or by context values the child reads.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Stabilize props that are recreated by the parent

Functions, objects, and arrays are compared by identity. Creating an inline function or a new object or array during every parent render produces a different reference, even when the function behaves the same or the value contains the same data. That changed prop defeats the default memo comparison.

Cache a function with useCallback

Use useCallback to retain a function reference while its dependencies remain unchanged. Include every reactive value used by the function in the dependency list. When a dependency changes, React returns a new function.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
const handleSelect = useCallback(item => {
  console.log('Selected', item.id);
}, []);

The empty dependency list is appropriate here because the callback reads no reactive values from the component. If it used a prop or state value, that value would need to be included. See the React useCallback reference.

Cache a calculated value with useMemo

Use useMemo to retain the result of a calculation while its dependencies remain unchanged. For a filtered list, this can keep the array reference stable during unrelated parent renders:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
const visibleItems = useMemo(
  () => items.filter(item =>
    item.name.toLowerCase().includes(query.toLowerCase())
  ),
  [items, query]
);

Here, a change to items or query recalculates the array. That is necessary because the displayed results may have changed. Do not omit reactive dependencies merely to preserve a cache; stale values can make the code incorrect. React says to rely on useMemo only as a performance optimization.

Putting the pieces together

This example lets the memoized child avoid work during unrelated parent updates when its props are stable. It is an illustrative pattern, not a benchmark:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
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, visibleItems changes and Results should render to show the updated matches. The goal is to avoid repeating that work when the parent updates for an unrelated reason and both child props remain stable.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Know which updates memoization cannot block

The child’s own state changes

A memoized component still renders when its own state changes. memo compares props; it does not freeze the component.

A context value changes

A component that reads a changed context updates even when wrapped in memo. Context changes propagate to consumers; memoization does not shield a consumer from a fresh provider value. If only part of a context consumer needs to respond, read the context in an outer component and pass the specific value to a memoized inner component. See React’s useContext reference.

A dependency changes

useCallback and useMemo refresh their cached result when a listed dependency changes under Object.is. That is expected behavior, not a failure. Include the values the calculation or function actually uses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Consider simpler fixes before adding more caches

  • Keep transient state close to where it is used. A local state update then need not make a broad parent component render.
  • Pass JSX as children to visual wrappers when appropriate. This can keep the wrapper’s contents from being recreated as part of the wrapper’s own rendering work.
  • Remove unnecessary Effects that update state. Avoiding an update chain can eliminate the renders at their source.
  • Simplify props. Avoid passing freshly created objects or arrays when a smaller set of stable values will do.
  • Use manual memoization selectively. React notes that most useCallback and useMemo calls have no benefit unless they support a memoized child, a Hook dependency, or an expensive calculation. Extra caches can reduce readability, and one always-new prop can defeat a memoized boundary.

Check whether React Compiler is enabled

React Compiler can automatically handle many memoization cases when it is installed, configured, and compiling the component. Do not assume it is active simply because the project uses React; confirm the project’s build and compiler setup. The current React Compiler documentation explains its role and setup.

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.