Question presented to candidate:
"React Compiler reached 1.0. What does it actually do to your code at build time, and does it mean you can delete every useMemo, useCallback, and React.memo in the codebase?"
What a strong answer should cover:
- It is a build-time tool (a Babel plugin), not a runtime feature — it rewrites your components during compilation.
- It performs automatic memoization: it infers what each component reads and produces, and caches values so they are only recomputed when their inputs change.
- The output leans on a runtime hook — exposed on React as
__COMPILER_RUNTIME.c, conventionallyuseMemoCache— which allocates a fixed-size cache array per component instance. - It relies on the Rules of React: components must be pure and props/state must not be mutated. Code that breaks those rules is skipped, not miscompiled.
- It is opt-in and incremental; you can adopt it directory by directory.
- Manual memoization is not forbidden and existing
useMemocalls keep working — but they become largely redundant in compiled files. - Version precision: React Compiler 1.0 shipped on 7 October 2025, and it supports React 17 through 19.
Clarifying questions expected:
- "Is the codebase already Rules-of-React clean — does it pass the ESLint rules?"
- "Which build tool are we on? The integration differs for Next.js, Vite, and plain Babel."
Code / implementation expected: Optional. Being able to describe the before-and-after shape of a compiled component is worth more than writing one out.