Performance · senior
React Compiler: automatic memoization
React Compiler 1.0 (October 2025) is a build-time tool that adds fine-grained memoization to components and hooks automatically, so new code rarely needs manual useMemo/useCallback; it only works on code that follows the Rules of React.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Status (Nov 2026): stable since v1.0 (7 Oct 2025). Works with React 17+ (for 17/18 set a target and add
react-compiler-runtime). - It runs at build time as
babel-plugin-react-compiler; Next.js has stablereactCompiler: true(off by default, Babel-based, slower builds) and an experimental Rust version (experimental.turbopackRustReactCompiler, 16.3+). Expo SDK 54+ enables it by default. Vite/Next templates offer it as an option. - It memoizes values, JSX and callbacks granularly, even conditionally and after early returns, which manual memoization cannot do.
- It skips (bails out of) code that breaks the Rules of React: mutating props/state during render, reading refs during render, conditional hooks.
- Compiler-powered lint rules ship in
eslint-plugin-react-hooks(recommendedpreset): for exampleset-state-in-render,set-state-in-effect,refs. The linter does not require the compiler. - Official advice: new code relies on the compiler and uses
useMemo/useCallbackonly for precise control (for example effect deps). Existing code: leave existing memoization in place or test carefully before removing it, because removing it can change output and when effects fire. - Rollout: fix lint violations first; adopt by directory (Babel overrides), annotation mode (
"use memo"), or runtime gating; use"use no memo"on a problem component temporarily; pin the exact version if test coverage is thin. - Meta reported up to 12% faster loads/navigations and some interactions 2.5x faster (Quest Store). It does not fix context re-renders or slow non-React code.
The red pen
Common traps: mistake → fix
Mistake: "The compiler makes re-renders impossible"
Fix: it reduces unnecessary work; state changes still re-render.
Mistake: "Remove all useMemo/useCallback in one PR after enabling it"
Fix: the React team advises leaving them or testing carefully.
Mistake: "It is still experimental / a beta"
Fix: 1.0 is stable; only the Rust version in Next.js is experimental.
Mistake: "Interviewers no longer ask memo questions"
Fix: Indian loops still ask the classic useMemo vs useCallback; answer both layers.
Easy to hard
Questions interviewers ask, easy to hard
- Does the React Compiler mean we can stop writing
useMemoanduseCallback? - What does it memoize that manual memo cannot?
- What code makes it bail out?
- Would you remove the existing manual memoization? Why not?
- You are the lead: plan the rollout for a 400-component app with flaky tests.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.