Enable, verify and adopt the React Compiler in a React 19 or Next.js 16 project, and answer whether a useMemo, useCallback or memo is still needed. Use when the user asks about React Compiler setup, its ESLint rules, migrating manual memoization away, "do I still need useMemo", or why a component is not compiled. NOT for general component style (react-rules).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of React 19 Compiler?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/janszewczyk-react-19-compiler)
---
name: react-19-compiler
description: Enable, verify and adopt the React Compiler in a React 19 or Next.js 16 project, and answer whether a useMemo, useCallback or memo is still needed. Use when the user asks about React Compiler setup, its ESLint rules, migrating manual memoization away, "do I still need useMemo", or why a component is not compiled. NOT for general component style (react-rules).
allowed-tools: Read, Write, Edit, Glob, Grep, Bash, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
---
# React Compiler
The rules for memoization and hooks are in the `react-rules` knowledge skill. This skill is the
procedure: turn the compiler on, check it works, and migrate a module off hand-written memoization.
The full reasoning is in the adoption guide linked from the index below.
## Enable
1. Check the setup in the project's own docs first (`next.config.*`, `package.json`, the lint
config), then confirm the current option names with Context7 (`react.dev/learn/react-compiler`,
Next.js `reactCompiler`): they changed between Next.js 15 and 16.
2. Install `babel-plugin-react-compiler` as a dev dependency and set `reactCompiler: true` at the top
level of `next.config.ts` (Next.js 16; `experimental.reactCompiler` before). Outside Next.js, add
the Babel plugin first in the plugin list.
3. Lint with the `recommended` preset of `eslint-plugin-react-hooks`; remove
`eslint-plugin-react-compiler` if present.
## Verify it is active
Open a component in React DevTools: compiled components show a `Memo ✨` badge. In a production build
the output imports `react/compiler-runtime`. A component without the badge breaks the Rules of
Hooks or React; run the lint rules on it and fix the code, not the rule.
## Migrate a module
1. Run the lint rules over the module and fix what they report.
2. Delete `useMemo`, `useCallback` and `memo` that only existed for performance, one module at a
time, and run the module's tests after each.
3. Keep a memoization only for the four cases in `react-rules`, each with a JSDoc comment saying why.
4. Before adding memoization back, profile with the React DevTools Profiler or `<React.Profiler>`; a
render under about 16 ms needs none.
<!-- BEGIN:knowledge -->
<!-- generated by knowledge.mjs from 4 note(s) (sha256 b96a78296bf0); edit the notes in knowledge/, then run build -->
| Impact | Rule | Applies to |
| --- | --- | --- |
| high | [Adopt the React Compiler and stop hand-writing memoization](references/rules.md#adopt-the-react-compiler-and-stop-hand-writing-memoization) — Compile every component, lint for what it skips, and keep manual memoization only for four documented cases. | typescript, react, react-compiler |
| high | [Leave memoization to the React Compiler; memoize by hand only in four documented cases](references/rules.md#leave-memoization-to-the-react-compiler-memoize-by-hand-only-in-four-documented-cases) — No useMemo, useCallback or memo by default; four exceptions, each with a JSDoc comment saying why. | typescript, react, react-compiler |
| medium | [Call hooks only at the top level of a component or custom hook](references/rules.md#call-hooks-only-at-the-top-level-of-a-component-or-custom-hook) — No hook inside a condition, loop, nested function or after an early return; React.use is the one exception. | typescript, react |
| medium | [Fix React Compiler lint diagnostics instead of switching the rules off](references/rules.md#fix-react-compiler-lint-diagnostics-instead-of-switching-the-rules-off) — The recommended preset carries the React Compiler rules; a disabled rule hides code the compiler silently skips. | typescript, react, react-compiler |
<!-- END:knowledge -->