Is it time to forget about useCallback & memo?


Hey friend,

This is one of the most exciting updates in the React ecosystem: the React Compiler ↗️.

I am incredibly excited because we can now use the Next.js 15 RC ↗️ with this compiler and eliminate many React hooks we've been using, such as useCallback, useMemo, memo, and more.

If you prefer to watch the video instead, then check out my latest video here πŸ‘‡

How does React Compiler ACTUALLY work?

video preview​

Our Weekly Snack: Is it time to forget useCallback or useMemo?

First of all, why are we questioning this? Well, that's because React compiler is out.

What is React Compiler?

React Compiler is an automatic optimizer for React code. It analyzes your components and optimizes them for performance, reducing the need for manual memoization with hooks πŸͺ like useMemo, useCallback, and memo.

These hooks are currently used to prevent unnecessary re-renders of components based on whether their props or state have truly changed.

React Compiler will optimize your React code provided you follow the Rules of React ↗️.

Now, not using hooks inside a function, function should always return the same output etc. are all part of the rules. These are rules we're aware of.

It can reduce the need for developers to manually add memoization code.

For example, you may not need to add useCallback and useMemo everywhere as React is going to optimize that for you.

Here is an example,

How you can get Next.js 15 React Compiler for a new project:

How can you enable React Compiler?

There are 2 modes:

  1. Opt-in
  2. Compile all Components

🧩 Opt-in mode: React Compiler can be enabled in annotation mode, which allows developers to control which components are optimized. This is seen in the left terminal.

✨ Compile all components: Setting it to true will get all components to get optimized.

Is React Compiler a Silver Bullet?

While React Compiler is a powerful tool, it's essential to remember:

  • 😎 Understanding Performance Optimization: A solid grasp of performance optimization techniques is still valuable. There might be situations where the compiler misses optimizations or requires your input for complex components.
  • πŸ§ͺ Experimental Stage: React Compiler is still under development, and its capabilities may evolve over time.

Latest Frontend News

Find out if people on Twitter 🚒 actually ship code or if they're just shiptalking with Ship Talkers ↗️.

​GPT skeleton ↗️ converts your components into Skeleton UI. You can simply copy paste.

​Beautiful Gradients ↗️ ready to use for your projects or apps or to add a little whimsy to your apps.

Add sounds to your application for user clicks or to have some fun, with the use-sound hook ↗️.

​Astro 4.10 is out ↗️ ✨ Changes include,

  • Easier environment variable management with a new astro:env module.
  • Broader rewrite functionality - now supports all HTTP methods.
  • Embed Astro components in server-side apps built with frameworks like PHP.
  • Streamlined Container API usage in Vite environments.

What if there was a Next.js form lib that does both client and server validation from one Zod schema, well, this is possible through conform ↗️.​

​Tailwind released a new version ↗️ of `prettier-plugin-tailwindcss` ✨ that automatically cleans up unnecessary whitespace in your class lists

Weekly Youtube Videos

Check it out and subscribe to my channel ↗️ for more Frontend, Leadership and Career Development content.

Modern Authentication Tutorial with Next.js | Clerk, Lucia, TypeScript, Tailwind

video preview​

The Most Underrated feature in Nextjs 15
​
​

video preview​

What do you think of today's Newsletter? Simply click on one of the links below.

Ankita Kulkarni

Join 9200+ subscribers reading by weekly personalized Newsletter that helps developers level up their skills through weekly Frontend and Leadership Snacks. You get a deep dive into a Tech topic, Actionable tips to excel in your career and a toolbox!

Read more from Ankita Kulkarni
You’re Suspending the Wrong Component

Hey Reader, There are thousands of you going through Modern Full Stack Next.js Course so wanted to be grateful here for your support. Just as a thank you, there is something big dropping for you. It will only last 24 hours ⏰ so keep an eye out for my email next week. Let's dive in! PRESENTED BY CLERK Instead of your coding agent guessing how auth works, you can now install specialized Clerk knowledge directly into it. Introducing Clerk Skills One simple command $ npx skills add clerk/skills...

Next.js bundle analyzer

Hey Reader, This week, we're putting your Next.js app under the microscope, what's slowing it down? This along with the latest news, can AI really debug complex React/Next.js bugs? How OpenClaw and Anthropic are enabling AI collaboration, 3 New Coding Models dropped and more. Let's dive in! 🍿 Our Weekly Snack: What's Really Slowing Down Your Next.js App? Have you ever wondered why your Next.js app feels sluggish or takes forever to load? 🐌 The new experimental Bundle Analyzer in Next.js 16.1...

git worktree

Hey Reader, A lot of you have been asking me how I’m able to stay so productive and get a lot of work done so I finally broke down my exact workflow and setup in a short video. 🍿 Our Weekly Snack: Run Multi Agents stress free with Claude Code Git work trees let you check out multiple branches at the same time each in its own folder all backed by the same repo. Instead of one working directory and constant branch switching, you get parallel workspaces. Each work tree has its own isolated...