Skip to content
Back to skills

React 19 Compiler

ASecurity

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).

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 13, 2026
developmenttypescriptbashreactnextjsperformance

Works with

  • mcp

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add JanSzewczyk/claude-plugins --skill react-19-compiler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React 19 Compiler?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React 19 Compiler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/janszewczyk-react-19-compiler/badge)](https://www.skillsdirectory.com/skills/janszewczyk-react-19-compiler)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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 -->

Files in this skill

  • SKILL.md5.1 KB
  • references/compiler-guide.md5.9 KB
  • references/hooks.md10.8 KB
  • references/server-components.md9.4 KB
  • references/when-to-memoize.md7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.