Skip to content
alyn
Gentleman-Programming

React 19 skill

React 19 patterns with React Compiler. Trigger: When writing React components - no useMemo/useCallback needed.

$npx skills add Gentleman-Programming/Gentleman-Skills --skill react-19
View this skill on GitHubGentleman-Programming/Gentleman-Skills/curated/react-19/SKILL.md
Pack stars
665
Pack installs
5.6k
Alyn Score
42/99
Updated
8 months ago
License
MIT
– views – installs via Alyn

Gentleman-Programming

React 19

Install React 19

Pick your agent. Every command is ready to paste.

$npx skills add Gentleman-Programming/Gentleman-Skills --skill react-19

The open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.

01

Install it

Run the command above, or upload the folder in Claude.

02

Ask naturally

Describe the task. Your agent loads react-19 when the request matches its description.

03

Name it if needed

If it does not trigger, say “use the react-19 skill”. In Codex, type $react-19.

The skill itself

SKILL.md

FolderGitHub

No Manual Memoization (REQUIRED)

// ✅ 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)

// ✅ ALWAYS: Named imports
import { useState, useEffect, useRef } from "react";

// ❌ NEVER
import React from "react";
import * as React from "react";

Server Components First

// ✅ 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

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

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

// ✅ 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} />);

Keywords

react, react 19, compiler, useMemo, useCallback, server components, use hook

Tips for React 19

  • • Start a fresh session after installing so your agent picks up the new skill.
  • • It is part of a pack with 24 skills. Install only the ones you need with --skill to keep triggers precise.
  • • If two skills overlap, mention the one you want by name.

Questions about React 19

What does the React 19 skill do?

React 19 patterns with React Compiler. Trigger: When writing React components - no useMemo/useCallback needed.

How do I install React 19?

Run "npx skills add Gentleman-Programming/Gentleman-Skills --skill react-19" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.

Does React 19 work in Cursor and Codex?

Yes. React 19 uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.

Is React 19 free?

React 19 is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.

Who made React 19?

React 19 is published by Gentleman-Programming in the Gentleman-Programming/Gentleman-Skills repository, together with 23 other skills.

Similar skills. From other creators.