react-patterns

Document React 19 patterns for Server Components, Actions, use(), and TypeScript development.

2|Updated Oct 12, 2025
One-click install
npx skills add https://github.com/haotool/app --skill react-patterns-haotool
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/haotool/app/tree/main/.agents/skills/react-patterns
Command: npx skills add https://github.com/haotool/app --skill react-patterns-haotool

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Patterns guide for adopting React 19's Server Components, Actions, use() and related APIs to accelerate modern app development.

Core Features & Use Cases

  • Server Components and Client Components interaction patterns
  • use() hook, useOptimistic, useFormStatus, useFormState and concurrent features
  • TypeScript-friendly patterns for component architecture and state management

Quick Start

Explain a minimal React 19 pattern setup to implement a Server Component with Client Component interaction using use(), useOptimistic, and form hooks.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I use the React 19 use() hook with Server Components?

The React 19 use() hook allows Client Components to read promises passed from Server Components, enabling concurrent rendering. This pattern integrates server-fetched data directly into the component tree for optimized data fetching and streaming.

What is the best way to implement optimistic UI in React 19?

The best way to implement optimistic UI in React 19 is by using the useOptimistic hook within your component state management. This pattern provides a TypeScript-friendly approach to immediately update the UI while form actions are processing in the background.

How do I track form submission status in React 19 without managing state?

You track form submission status in React 19 by utilizing the useFormStatus hook within your component architecture. This pattern automatically exposes the pending state of the parent form, eliminating the need for manual state management during Actions processing.

Does React 19 form handling work with TypeScript for server actions?

Yes, React 19 form handling works seamlessly with TypeScript for server actions by applying structured useFormState patterns. This provides type-safe component design and state management, ensuring robust integration between your frontend architecture and server-side execution.

When should I use Server Components instead of Client Components in my frontend architecture?

You should use Server Components instead of Client Components when fetching data or integrating backend logic directly into your frontend architecture. This pattern minimizes client-side JavaScript and leverages concurrent features for faster initial rendering.