/react-19:validating-formsfrom react-19
Teaches client and server-side form validation patterns in React 19 with Server Actions. Use when implementing form validation, input checking, or error handling.
Ships in react-19. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
React 19 forms require validation on both client and server.
Use HTML5 validation + custom logic:
<form action={submitForm}>
<input
name="email"
type="email"
required
pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"
/>
<input
name="age"
type="number"
min="18"
max="120"
required
/>
<button type="submit">Submit</button>
</form>
Always validate on server - client validation can be bypassed:
'use server';
import { z } from 'zod';
const schema = z.object({
email: z.string().email('Invalid email'),
age: z.number().min(18, 'Must be 18+').max(120),
password: z.string().min(8, 'Password must be 8+ characters'),
});
export async function registerUser(previousState, formData) {
const data = {
email: formData.get('email'),
age: Number(formData.get('age')),
password: formData.get('password'),
};
const result = schema.safeParse(data);
if (!result.success) {
return {
errors: result.error.flatten().fieldErrors,
};
}
try {
const user = await db.users.create({ data: result.data });
return { success: true, userId: user.id };
} catch (error) {
if (error.code === 'P2002') {
return { errors: { email: ['Email already exists'] } };
}
return { error: 'Registration failed' };
}
}
'use client';
import { useActionState } from 'react';
import { registerUser } from './actions';
export default function RegisterForm() {
const [state, formAction, isPending] = useActionState(registerUser, null);
return (
<form action={formAction}>
<div>
<input name="email" type="email" required />
{state?.errors?.email && (
<span className="error">{state.errors.email[0]}</span>
)}
</div>
<div>
<input name="age" type="number" required />
{state?.errors?.age && (
<span className="error">{state.errors.age[0]}</span>
)}
</div>
<div>
<input name="password" type="password" required />
{state?.errors?.password && (
<span className="error">{state.errors.password[0]}</span>
)}
</div>
<button type="submit" disabled={isPending}>
{isPending ? 'Registering...' : 'Register'}
</button>
{state?.error && <p className="error">{state.error}</p>}
{state?.success && <p>Registration successful!</p>}
</form>
);
}
Recommended: Zod for type-safe validation:
import { z } from 'zod';
const schema = z.object({
email: z.string().email(),
password: z.string().min(8),
confirmPassword: z.string(),
}).refine(data => data.password === data.confirmPassword, {
message: "Passwords don't match",
path: ['confirmPassword'],
});
For comprehensive validation patterns, see: research/react-19-comprehensive.md.
Zod v4 Validation:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub djankies/claude-configs --plugin react-1926 skills in this plugin
/composing-componentsTeaches component composition patterns in React 19 including children prop, compound components, and render props. Use when designing component APIs, creating reusable components, or avoiding prop drilling./following-the-rules-of-hooksFix React Rules of Hooks violations - conditional calls, hooks in loops/callbacks/classes/implementing-code-splittingTeaches code splitting with lazy() and Suspense in React 19 for reducing initial bundle size. Use when implementing lazy loading, route-based splitting, or optimizing performance.Other plugins' skills for the same job