🤯 Wait… React 19 is gonna kill useMemo and useCallback?!

A deep dive into React 19 rumors and what it might mean for our beloved (and sometimes overused) memoization hooks. Spoiler: maybe we've been overthinking performance optimization all along.

• By Ehsan Pourhadi •
React Performance

So I was doomscrolling through DEV comments (as one does when you’re ā€œtaking a short breakā€ but actually procrastinating for 2 hours šŸ˜…), and I stumbled on this spicy take:

šŸ‘‰ ā€œuseMemo and useCallback will be useless in React 19!ā€

And my brain was like: what?! excuse me, sir, those are literally my security blankets in React.


Me & my love/hate story with useMemo

I remember the first time I learned about useMemo. It was one of those ā€œyou don’t really need this but here’s a cool trickā€ things, kinda like discovering console.table in the browser console (mind = blown).

But also… confusing af. Like, do I memoize everything? Nothing? My grocery list? šŸ›’

// Me, circa 2022, memoizing EVERYTHING
const expensiveCalculation = useMemo(() => {
  return 2 + 2; // Very expensive math, clearly
}, []);

const memoizedString = useMemo(() => {
  return "hello world"; // Such optimization, wow
}, []);

Then useCallback came along and I was like, ā€œokay now I’m just wrapping functions for no reason.ā€ Half the time it fixed nothing, but hey, at least my code looked professional šŸ˜‚

Fast-forward a bit → I got into the habit: oh, function as a prop? slap a useCallback on it! Expensive calculation? useMemo it! Woohoo optimization nation!

// My old code be like:
const handleClick = useCallback(() => {
  console.log("clicked"); // Very callback, much memo
}, []);

const handleSubmit = useCallback(
  (data) => {
    submitForm(data); // Definitely needed this wrapper
  },
  [submitForm]
);

Enter React 19 rumors šŸ‘€

Now, this comment says React 19 is making these hooks basically useless. Like… not deprecated, but redundant. The React team is apparently cooking some next-level optimizations, so a lot of manual memoization might just disappear.

Think: React gets smarter → you get lazier → code gets cleaner. (yes please šŸ™)

I mean, frameworks like SolidJS and Svelte already flex with this whole ā€œfine-grained reactivityā€ thing, where the UI updates only the stuff that changes. If React adopts something similar, why would I waste brain cells wrapping everything in useMemo?

What this might look like:

// Current React: Manual optimization everywhere
const MyComponent = ({ items, filter }) => {
  const filteredItems = useMemo(() => {
    return items.filter((item) => item.category === filter);
  }, [items, filter]);

  const handleItemClick = useCallback(
    (id) => {
      onItemClick(id);
    },
    [onItemClick]
  );

  return (
    <div>
      {filteredItems.map((item) => (
        <Item key={item.id} onClick={handleItemClick} />
      ))}
    </div>
  );
};

// React 19 (maybe?): Just write normal code
const MyComponent = ({ items, filter }) => {
  const filteredItems = items.filter((item) => item.category === filter);

  const handleItemClick = (id) => {
    onItemClick(id);
  };

  return (
    <div>
      {filteredItems.map((item) => (
        <Item key={item.id} onClick={handleItemClick} />
      ))}
    </div>
  );
};

But will it really happen?

Here’s the thing… React is like the Marvel Cinematic Universe. Big, messy, tons of fans, lots of backwards compatibility baggage. They can’t just snap their fingers like Thanos and say ā€œlol no more useMemoā€.

So yeah, maybe in React 19 these hooks won’t be as necessary, but I doubt they’ll vanish overnight. They’ll probably still hang around for:

  • Old projects that need migration
  • Library authors who need fine-grained control
  • Paranoid devs (hi, that’s me šŸ‘‹)
  • Edge cases where manual optimization is still needed

Also, ngl, sometimes memoization is just placebo. I’ve legit wrapped tiny functions in useCallback thinking I’m saving the world, when in reality React’s like: ā€œbro… that did nothing.ā€ šŸ˜‚

The reality check:

Most of the time, our components aren’t actually slow because of missing memoization. They’re slow because of:

  • Massive component trees
  • Too many re-renders from state changes
  • Heavy computations that shouldn’t be in render functions anyway
  • Poor data structures

What the experts are saying

The React team has hinted at some wild stuff coming:

  • Automatic memoization: React might just figure out what to memoize on its own
  • Better scheduling: Smarter about when and how to update components
  • Compile-time optimizations: Your build tool might optimize React code before it hits the browser

Dan Abramov tweeted something like ā€œstop premature optimizationā€ (paraphrasing), and honestly, maybe he’s right. Maybe we’ve been overthinking this whole time.


My takeaway (aka me pep-talking myself)

Honestly, I’m kinda excited about this future. Because if React 19 really makes useMemo and useCallback useless, that means less boilerplate, fewer bugs, and one less thing for beginners (like me!) to overthink.

And that’s a win.

My new strategy:

  1. Write clean, readable code first
  2. Profile and measure actual performance issues
  3. Optimize only when there’s a real problem
  4. Trust React to get smarter over time

So yeah… maybe one day we’ll look back and laugh at our old code sprinkled with useMemo like confetti. Until then, I’ll keep slapping them in my code whenever I panic about performance. Don’t judge me.

// Future me looking at 2024 code:
const needlessOptimization = useMemo(() => {
  return "Why did I wrap a string in useMemo? šŸ¤¦ā€ā™‚ļø";
}, []);

The bottom line

React 19 might make our manual optimizations obsolete, but that’s actually amazing news. It means we can focus on building great user experiences instead of micro-managing every render cycle.

Plus, if React gets this right, it’ll make the framework more approachable for everyone. No more ā€œshould I useMemo this?ā€ anxiety. No more cargo-cult programming with useCallback.

Just clean, fast React code that works.

Now if you’ll excuse me, I need to go remove 47 unnecessary useCallbacks from my current project… šŸ˜…


What do you think? Are you excited about potentially simpler React code, or will you miss the control that manual memoization gives you? Let me know in the comments. (when I get time to vibecode a comment section)

Tags: #React 19 #useMemo #useCallback #Performance #Hooks