What does this skill do?

The Modern React Patterns Skill provides a guide to idiomatic patterns for React 18 and 19, addressing common challenges related to architecture, rendering, state management, and the boundaries between server- and client-side components. It helps you write clean, predictable, and accessible code, minimizing the misuse of `useEffect` and taking advantage of modern native APIs such as `useActionState` and `useOptimistic`.

Component Design
When writing or modifying functional components, custom hooks, or component trees in accordance with best practices.
JSX/TSX Code Review
Review React code to ensure that idiomatic patterns are used and to avoid common rendering errors.
Migration of Class Components
Migrate legacy code or fix problematic, intensive use of `useEffect` by adopting modern patterns.
Forms with React 19 Actions
Implement asynchronous forms using `useActionState`, native validation, and optimistic UI feedback.

Usage examples

🧩 Report status
I have a component that uses `useEffect` and `useState` to calculate a filtered value. How do I refactor it to derive the state during rendering?
⚛️ CSR Limits
Take a look at this component tree and tell me which ones should be Server Components and which ones should be Client Components.
📝 Form with Actions
Create a contact form using React 19's `useActionState` with validation and UI feedback.
🔍 Debounce hook
Write a custom `useDebounce` hook for a search box to prevent excessive API calls.

Features

State derived during rendering Calculate derived data directly within the render body, avoiding extra loops and desynchronization.
Server/Client Component Limits Define which components are server-side for asynchronous data fetching, and mark only the interactive ones with "use client."
Efficient Status Management Choose between useState, Context, and external stores (Zustand, Redux) based on the update frequency and scope of the state.
Forms with React 19 Actions Use `useActionState` and `useOptimistic` for asynchronous submissions, validation, and optimistic UI out of the box.
Accessibility by Default Prioritize semantic HTML, keyboard navigation, and associated tags over role attributes.

Frequently asked questions

It covers both. It includes specific React 19 patterns such as `useActionState` and `useOptimistic`, as well as general patterns that apply to React 18.
No. It's a guide and pattern skill that works directly with Claude Code or Cowork without any additional configuration.
Yes. The skill includes patterns for migrating legacy code and fixing problematic uses of `useEffect` to modern approaches.
The skill provides guidance on when to use `useState`, `Context`, or external stores such as Zustand or Redux, depending on the update frequency, without imposing a single solution.
Modern React Patterns — Architecture and Best Practices with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.