October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Do You Still Need useCallback? What React Compiler Changes

React Compiler can handle ordinary callback memoization in new code, but useCallback still has a role when you need precise control. Here’s what to keep, test, and know before rollout.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For ordinary callback memoization in new React code, you usually do not need to add useCallback everywhere: React recommends relying on React Compiler to infer memoization. Keep useCallback when you need precise control over a stable function identity, and do not remove existing calls across a codebase without testing. The compiler is a build-time optimizer, not a promise that every function will be cached.

How React Compiler changes callback memoization

React Compiler analyzes components and hooks at build time and can add memoization automatically. For new code, the React team recommends relying on that analysis for ordinary memoization, using useMemo or useCallback when precise control is needed. This reduces manual bookkeeping; it is not a claim that every callback is optimized or that a particular app will become faster by a measurable amount. React’s October 7, 2025 announcement of React Compiler 1.0 describes the recommendation.

As an Amazon Associate I earn from qualifying purchases.

The benefit is especially clear when manually stabilizing one function does not stabilize the function actually passed to a child. React’s introduction shows a handleClick wrapped in useCallback, then passed to list items through an inline arrow function such as () => handleClick(item). That arrow is newly created on each render. The compiler can optimize this pattern without requiring you to manually stabilize every layer. React’s compiler introduction presents it as an example, not a benchmark.

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

When keeping useCallback makes sense

useCallback remains available when you want explicit control over a function’s identity. One documented use is keeping a function stable when it is a dependency of an Effect, so the Effect does not rerun merely because a new function was created during rendering. React describes the hook as a performance optimization, however, and its cached value may be discarded in certain circumstances. Correctness should not depend on that cache being permanent. See the useCallback API reference.

  • Keep it when you have a specific need for a stable function identity, such as an Effect dependency.
  • Do not add it reflexively to every event handler in new code.
  • Measure or inspect the actual behavior before introducing memoization solely in pursuit of a presumed performance gain.

Should you remove existing useCallback calls?

Not all at once. React advises leaving existing manual memoization in place or carefully testing before removing it, because manual memoization can affect the compiler’s output. A cleanup that deletes every useCallback call may change which code is compiled or how it behaves.

Review calls individually: determine whether a stable identity is needed, confirm the affected components are eligible for compilation, and test the changed behavior. React’s compiler introduction discusses the interaction with existing memoization.

What the compiler does—and does not—optimize

The compiler primarily targets component update performance. It can skip cascading rerenders and memoize some expensive calculations within components and hooks. It does not memoize every ordinary JavaScript function, and a calculated value is not automatically shared as a cache across separate components or hooks. If expensive work is shared across components, profile the application and choose a suitable strategy rather than assuming compiler memoization will provide a shared cache. React’s introduction outlines these boundaries.

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

Compatibility and a cautious rollout

React announced React Compiler 1.0 as stable on October 7, 2025, calling it production-ready and noting its use at Meta. Stable does not mean every application should enable it everywhere without checking its code. React’s guidance ties successful adoption to following the Rules of React and the health of the codebase. The release announcement and introduction describe both points.

The installation guide lists React 17, 18, and 19 as supported, with React 19 the best fit, and documents the Babel plugin plus integrations for Babel, Vite, Metro, and Rsbuild. React’s introduction also identifies Next.js 15.3.1 and later as supporting the compiler through SWC. These framework and toolchain details can change, so check the current guide for your setup.

  1. Start with a small area. Follow React’s incremental adoption guidance and verify behavior and performance before expanding.
  2. Use controlled compilation where appropriate. Annotation mode can compile functions marked with "use memo"; runtime gating can support a controlled rollout. The installation and adoption guides explain the available options.
  3. Inspect compiler coverage. After setup, React DevTools can show a “Memo ✨” badge for compiled components. See the installation guide.
  4. Exclude a problem area temporarily if needed. React documents "use no memo" as a way to exclude a component while investigating an issue. See the incremental adoption guide.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to test before expanding adoption

Do not make application correctness depend on referential equality or on a memoized reference persisting forever. Changes to memoization can affect code that relies on stable references in Effect dependency arrays; React warns that problems can range from Effects firing too often to loops or missed updates. Check the relevant dependency behavior and exercise important flows with end-to-end tests when adopting or upgrading the compiler. React’s troubleshooting guidance covers these risks.

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.