What problem does it solve?
Provides a single, practical reference to apply React 19's new architecture and APIs so engineers can design components, forms, and server/client boundaries correctly and avoid common migration and performance pitfalls.
Core Features & Use Cases
- Server vs Client Architecture: Clear guidance for deciding when to use Server Components, Client Components, and how to pass data and interactions between them.
- Modern Hooks & Forms: Patterns and examples for use(), useOptimistic, useFormState, useFormStatus, useTransition, and other concurrent hooks.
- Server Actions & Validation: Best practices for writing 'use server' actions, validating input, handling optimistic updates, and revalidating caches.
- Performance & Compiler: Recommendations for using the React Compiler, avoiding premature memoization, and optimizing expensive computations.
- TypeScript & Testing: Type-safe component patterns, generic components, and test strategies for server actions, optimistic updates, and Suspense flows.
- Use Case: Migrating an existing Next.js codebase to React 19 by converting data fetching to Server Components, introducing Server Actions for mutations, and applying optimistic UI for smoother UX.
Quick Start
Use react-patterns to refactor a component to Server Component for data fetching and expose a small Client Component that uses useFormState and a 'use server' action to handle form submission.