
React 19
Ship React 19 UI with Compiler-safe hooks, imports, and Server/Client component boundaries without fighting manual memoization.
Overview
react-19 is an agent skill for the Build phase that enforces React 19 and React Compiler-safe component and hook patterns in `.tsx` files.
Install
npx skills add https://github.com/prowler-cloud/prowler --skill react-19What is this skill?
- Explicit React Compiler rule: no `useMemo`/`useCallback`—derive and handlers inline unless the compiler cannot optimize
- Required named imports from `react` (no default or namespace imports)
- Server Components by default; `'use client'` only for interactivity
- Pairs with nextjs-16 when using App Router or Server Actions
- Scoped auto-invoke trigger: writing React components in React 19 codebases
Adoption & trust: 510 installs on skills.sh; 14k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are on React 19 but still reach for `useMemo`, default React imports, or unnecessary client components, which fights the compiler and invites inconsistent App Router boundaries.
Who is it for?
Solo builders writing React 19 `.tsx` in Vite, CRA successors, or Next apps who want Compiler-aligned defaults without memorizing the rule set.
Skip if: Teams still on React 17/18 without the Compiler, or greenfield Next work where nextjs-16 should lead App Router and Server Actions design.
When should I use this skill?
When writing React 19 components/hooks in .tsx (React Compiler rules, hook patterns, refs as props). If using Next.js App Router/Server Actions, also use nextjs-16.
What do I get? / Deliverables
After the skill runs, components follow Compiler-first patterns, named imports, and Server-first structure so UI code is ready for review and pairing with nextjs-16 when needed.
- React 19 components and hooks following Compiler and import rules
- Server/Client split aligned with interactivity needs
Recommended Skills
Journey fit
Canonical shelf is Build because the skill applies while authoring `.tsx` components and hooks during product implementation. Frontend is the primary artifact surface—component patterns, refs-as-props, and `'use client'` gates are all UI-layer concerns.
How it compares
Use instead of generic React snippets that still teach manual memoization from the hooks era.
Common Questions / FAQ
Who is react-19 for?
Indie and solo frontend developers shipping React 19 UIs with the React Compiler who want an agent-enforced style guide during implementation.
When should I use react-19?
Use it in Build → frontend whenever you create or refactor components and hooks in `.tsx`, especially when triggers mention React Compiler rules, refs as props, or before mixing in Next.js App Router work (then also use nextjs-16).
Is react-19 safe to install?
Review the Security Audits panel on this Prism page for prowler-cloud/prowler and confirm allowed-tools (Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task) match what you permit in your agent.
Workflow Chain
Then invoke: nextjs 16
SKILL.md
READMESKILL.md - React 19
## No Manual Memoization (REQUIRED) ```typescript // ✅ React Compiler handles optimization automatically function Component({ items }) { const filtered = items.filter(x => x.active); const sorted = filtered.sort((a, b) => a.name.localeCompare(b.name)); const handleClick = (id) => { console.log(id); }; return <List items={sorted} onClick={handleClick} />; } // ❌ NEVER: Manual memoization const filtered = useMemo(() => items.filter(x => x.active), [items]); const handleClick = useCallback((id) => console.log(id), []); ``` ## Imports (REQUIRED) ```typescript // ✅ ALWAYS: Named imports import { useState, useEffect, useRef } from "react"; // ❌ NEVER import React from "react"; import * as React from "react"; ``` ## Server Components First ```typescript // ✅ Server Component (default) - no directive export default async function Page() { const data = await fetchData(); return <ClientComponent data={data} />; } // ✅ Client Component - only when needed "use client"; export function Interactive() { const [state, setState] = useState(false); return <button onClick={() => setState(!state)}>Toggle</button>; } ``` ## When to use "use client" - useState, useEffect, useRef, useContext - Event handlers (onClick, onChange) - Browser APIs (window, localStorage) ## use() Hook ```typescript import { use } from "react"; // Read promises (suspends until resolved) function Comments({ promise }) { const comments = use(promise); return comments.map(c => <div key={c.id}>{c.text}</div>); } // Conditional context (not possible with useContext!) function Theme({ showTheme }) { if (showTheme) { const theme = use(ThemeContext); return <div style={{ color: theme.primary }}>Themed</div>; } return <div>Plain</div>; } ``` ## Actions & useActionState ```typescript "use server"; async function submitForm(formData: FormData) { await saveToDatabase(formData); revalidatePath("/"); } // With pending state import { useActionState } from "react"; function Form() { const [state, action, isPending] = useActionState(submitForm, null); return ( <form action={action}> <button disabled={isPending}> {isPending ? "Saving..." : "Save"} </button> </form> ); } ``` ## ref as Prop (No forwardRef) ```typescript // ✅ React 19: ref is just a prop function Input({ ref, ...props }) { return <input ref={ref} {...props} />; } // ❌ Old way (unnecessary now) const Input = forwardRef((props, ref) => <input ref={ref} {...props} />); ```