react-dev

Implements React 18-19 TypeScript patterns for components, hooks, effects, and Server Components.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/leonardoacosta/skills --skill react-dev-leonardoacosta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-dev
Source: https://github.com/leonardoacosta/skills/tree/main/web-frontend-kit/skills/react-dev
Command: npx skills add https://github.com/leonardoacosta/skills --skill react-dev-leonardoacosta

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React codebases accumulate subtle bugs from misused useEffect hooks, outdated forwardRef patterns, and untyped event handlers. This Skill provides decision trees and typed patterns so components, hooks, and Server Components follow React 19 conventions correctly the first time. ## Core Features & Use Cases - useEffect Decision Tree: Determines when effects are actually needed versus derived state, key props, event handlers, or useMemo, with 9 documented anti-patterns and BAD/GOOD code pairs. - React 19 Migration Patterns: Covers ref as prop replacing forwardRef, useActionState replacing useFormState, use() for unwrapping promises, useOptimistic, and useTransition. - Generic Component Patterns: Provides type-safe Table, Select, List, Modal, and FormField implementations using constrained generics, keyof access, and discriminated union props. - Use Case: When reviewing a component that fetches data in useEffect without cleanup, the Skill identifies the race condition and rewrites it with an ignore flag or a custom hook pattern. ## Quick Start Review this React component and fix any useEffect anti-patterns or React 19 migration issues.

Frequently Asked Questions about react-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix useEffect derived state in React?

Compute derived values directly during render instead of storing them in useState with a useEffect. If the calculation is expensive, wrap it in useMemo. This eliminates the extra render pass with stale intermediate state.

How do I migrate from forwardRef to React 19 ref as prop?

In React 19, ref is a regular prop, so accept it in the props object typed as React.Ref<HTMLElement> and pass it to the underlying element. forwardRef still works but is deprecated and no longer necessary.

What is the difference between useActionState and useFormState?

useActionState replaces useFormState in React 19 for managing form submission state with Server Actions. It returns the current state, a form action, and an isPending flag, and works outside of form contexts as well.

When should I use Server Components versus Client Components?

Use Server Components for async data fetching and static rendering without hooks or browser APIs. Add the "use client" directive only to components needing state, effects, or event handlers, and push that boundary to leaf components.

Why does my React data fetch show stale results?

Fetching in useEffect without cleanup causes race conditions where a slow earlier response overwrites a newer one. Add a cleanup function with an ignore flag, or use a framework data-fetching solution like React Query or SWR.

When should I not use useEffect in React?

Avoid useEffect for derived state, responding to user events, resetting state on prop changes, and notifying parents. Use render-time computation, event handlers, the key prop, and direct callback invocation instead.