React Compiler reached 1.0 in October 2025. It is a build-time tool that analyzes components and inserts memoization for you, so most useMemo, useCallback and React.memo calls become unnecessary.
Before and after
You write plain code:
function ProductList({ products, query }: Props) {
const visible = products.filter((p) => p.name.includes(query));
const onSelect = (id: string) => track('select', id);
return visible.map((p) => (
<ProductCard key={p.id} product={p} onSelect={onSelect} />
));
}
The compiler memoizes visible and onSelect where it is safe. No manual hooks, no dependency arrays to get wrong.
Enable it in Next.js
Next.js supports the compiler through a config option (it requires the Babel plugin, so builds are slightly slower):
// next.config.ts
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
reactCompiler: true,
};
export default nextConfig;
Install the plugin first: npm install --save-dev babel-plugin-react-compiler.
Adopt incrementally
Start with an opt-in mode, so only annotated components are compiled:
// babel config
module.exports = {
plugins: [['babel-plugin-react-compiler', { compilationMode: 'annotation' }]],
};
function HeavyChart(props: ChartProps) {
'use memo';
// ...
}
Once the team is comfortable, switch to compiling everything and use 'use no memo' to opt out specific components that misbehave.
It relies on the Rules of React
The compiler assumes components are pure and that you do not mutate props, state or values during render. The lint rules in eslint-plugin-react-hooks flag violations. Fix those first, because code the compiler cannot prove safe is skipped rather than broken.
When to keep manual memoization
- A value used as an effect dependency where you need precise control over when it changes.
- Existing, well-tested code. Do not rip it out just because you can.
Measure
Use the React DevTools Profiler before and after. The benefit shows up in render-heavy screens; for small apps the difference may be invisible, but the code is simpler either way.