react

Build React 19 components with composition, hooks, and async data handling.

15|2|Updated May 23, 2026
One-click install
npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill react-vkirill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/VKirill/antigravity-for-claude-code/tree/main/skills/react
Command: npx skills add https://github.com/VKirill/antigravity-for-claude-code --skill react-vkirill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill prevents common React 19 mistakes by guiding you to use the right composition, hooks, state primitives, and performance approach for modern component development.

Core Features & Use Cases

  • React 19 composition & architecture: build compound components, polymorphic components, and ref-as-prop APIs without forwardRef in new code.
  • Hooks, state, and async UI correctness: apply React 19 state patterns with useActionState, useOptimistic, use(), Suspense, Error Boundaries, and derived-state rules that avoid effect-based derivation.
  • Performance & React Compiler readiness: decide when to rely on the React Compiler vs when to use manual memo/useMemo/useCallback, plus useTransition, useDeferredValue, and virtualization.
  • Server Components decisioning: choose Server vs Client boundaries and implement Suspense streaming with the correct caveats.

Quick Start

Use the react skill to build a React 19 feature by asking: "Implement an optimistic todo list using useActionState and useOptimistic in React 19, with Suspense and an ErrorBoundary for loading failures."

Frequently Asked Questions about react

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

FAQPage Schema
How do I replace forwardRef with ref as a prop in React 19?

In React 19, you can pass `ref` as a standard prop directly to function components without `forwardRef`. This simplifies component APIs and is the recommended pattern for building new compound and polymorphic components.

How do I implement optimistic UI updates with useActionState and useOptimistic?

Use `useOptimistic` to immediately show expected state changes while `useActionState` manages the async form submission. This combination allows you to build UIs that feel responsive during server mutations.

When should I use the React Compiler instead of manual memoization?

Rely on the React Compiler for automatic memoization in most cases. Manually use `useMemo`, `useCallback`, or `useTransition` only when critical performance bottlenecks require fine-grained control over re-renders.

How do I handle async data loading with use() and Suspense in React 19?

Use the `use()` hook to read promises directly inside components, wrapping them in Suspense boundaries to display fallback UI. Always pair this with Error Boundaries to catch and handle loading failures gracefully.

How do I decide between Server Components and Client Components?

Choose Server Components for static content and direct data fetching to reduce client bundle size. Use Client Components only for interactive elements requiring state, effects, or browser APIs.

Why should I avoid deriving state with useEffect in React 19?

Deriving state during render is preferred over using `useEffect`. If state depends on props or other state, calculate it directly in the render body to prevent unnecessary re-renders and effect loops.