React Compiler interview
What is the React Compiler, and does it mean you should delete all useMemo/useCallback?
Answers use simple, clear English.
Quick interview answer
The React Compiler auto-memoizes components and values where it can prove safety, reducing manual memoization. You should still write pure components and follow Rules of React. Don't blindly delete memos in hot paths until measured; keep intentional memos that document expensive work.
Detailed answer
The React Compiler auto-memoizes components and values where it can prove safety, reducing manual memoization. You should still write pure components and follow Rules of React. Don't blindly delete memos in hot paths until measured; keep intentional memos that document expensive work. Impure renders (mutating during render) break compiler assumptions.
Real example & use case
Enable compiler in CI; remove redundant memos after profiling a dashboard.
Pros & cons
Pros: fewer dependency-array bugs. Cons: build setup; purity still required.