skills/calel33/react-19/SKILL.md
Guide for React 19 development with Actions, Server Components, and new hooks. Use for building React 19 apps, form handling, optimistic updates, and migrations.
npx skillsauth add aiskillstore/marketplace react-19Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
React 19 (stable since Dec 2024) simplifies async operations, improves SSR, and enhances DX with Actions, Server Components, and new hooks.
npm install [email protected] [email protected]
npm install --save-dev @types/[email protected] @types/[email protected]
Required: Enable modern JSX transform in tsconfig.json:
{ "compilerOptions": { "jsx": "react-jsx" } }
| Type | Runs | State | Access | |------|------|-------|--------| | Server Component | Server | No | DB, FS, Secrets | | Client Component | Browser | Yes | DOM, Browser APIs | | Server Action | Server | No | DB, APIs |
"use server" = Server Action"use client" = Client Componentasync component = Auto-suspends'use client';
import { useActionState } from 'react';
function SignupForm() {
const [state, formAction, isPending] = useActionState(
async (prev, formData) => {
const error = await createUser(formData.get('email'));
return error ? { error } : null;
},
{ error: null }
);
return (
<form action={formAction}>
<input type="email" name="email" required />
<button disabled={isPending}>
{isPending ? 'Signing up...' : 'Sign Up'}
</button>
{state.error && <p>{state.error}</p>}
</form>
);
}
'use client';
import { useOptimistic } from 'react';
function Comments({ comments, addComment }) {
const [optimistic, addOptimistic] = useOptimistic(
comments,
(curr, newComment) => [...curr, { ...newComment, pending: true }]
);
return (
<div>
{optimistic.map(c => <div key={c.id}>{c.text}</div>)}
<form action={async (formData) => {
addOptimistic({ id: Date.now(), text: formData.get('text') });
await addComment(formData);
}}>
<input name="text" />
<button>Post</button>
</form>
</div>
);
}
'use server';
export async function createPost(formData) {
const title = formData.get('title');
if (!title || title.length < 3) {
return { error: 'Title too short' };
}
await db.posts.create({ title });
revalidatePath('/posts');
}
export default function Dashboard() {
return (
<div>
<Suspense fallback={<Skeleton />}>
<RevenueCard />
</Suspense>
<Suspense fallback={<Skeleton />}>
<UsersCard />
</Suspense>
</div>
);
}
async function RevenueCard() {
const data = await db.analytics.getRevenue();
return <div>{data}</div>;
}
// 1. Always authenticate
'use server';
export async function deleteUser(id) {
const user = await getCurrentUser();
if (!user) throw new Error('Unauthorized');
await db.users.delete(id);
}
// 2. Keep secrets server-side
'use server';
export async function fetchData() {
const secret = process.env.API_SECRET; // Inside function!
return fetch(url, { headers: { Authorization: `Bearer ${secret}` }});
}
// 3. Validate inputs
import { z } from 'zod';
const schema = z.object({ email: z.string().email() });
const result = schema.safeParse(formData);
See references/security-guide.md for complete security guidance.
npm install react@19 react-dom@19npx codemod@latest react/19/migration-recipenpx types-react-codemod@latest preset-19 ./srcKey breaking changes:
ReactDOM.render → createRootPropTypes removed → Use TypeScriptforwardRef deprecated → Use ref as propuseRef() requires argument → useRef(null)See references/upgrade-checklist.md and references/migration-patterns.md.
| Hook | Purpose |
|------|---------|
| useActionState | Form state with async actions |
| useOptimistic | Instant UI feedback |
| use() | Read promises/context (can be conditional) |
| useTransition | Non-urgent updates |
See references/hooks-api.md for detailed API docs.
| Task | Solution |
|------|----------|
| Forms | useActionState + Server Actions |
| Instant UI | useOptimistic |
| Data fetching | Server Components with async/await |
| Refs | ref as regular prop |
| Progressive rendering | Suspense boundaries |
Version: 2.1 | Updated: 2025-12-27
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.