react-patterns

Implement React 19 patterns with Server Components, Actions, and form hooks.

322|37|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill react-patterns-giuseppe-trisciuoglio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/giuseppe-trisciuoglio/developer-kit/tree/main/skills/react
Command: npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill react-patterns-giuseppe-trisciuoglio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a practical, modern guide to React 19 patterns, including Server Components, Actions, use() context, optimistic UI, form patterns, Suspense, and advanced TypeScript usage. It helps you accelerate architecture decisions, standardize patterns, and reduce boilerplate across React projects.

Core Features & Use Cases

  • Server Components and Actions patterns for server/client boundaries
  • use() hook patterns and optimistic UI approaches
  • useFormState, useFormStatus integration for form-heavy apps
  • Patterns for Suspense, concurrent rendering, and performance optimization
  • Modern TypeScript/TSX patterns for scalable React apps

Quick Start

Begin by scanning the Patterns guide and apply Server Components, Actions, and Suspense in a small component to observe performance and UX improvements.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I implement Server Components and Actions in React 19?

Server Components and Actions in React 19 let you execute server-side logic directly within your component tree, eliminating client-side data fetching and reducing bundle size. Use the 'use server' directive to mark functions as server actions, then call them from client components to handle form submissions and data mutations securely.

What's the best way to handle optimistic UI updates in React 19?

React 19's useOptimistic hook enables optimistic UI by updating the UI immediately while server actions process in the background. Combine it with useFormStatus to track form submission state, creating fast, responsive experiences that reflect user intent before server confirmation arrives.

When should I use Suspense with concurrent rendering in React 19?

Suspense with concurrent rendering handles asynchronous data loading and code splitting by pausing component render until data arrives, displaying fallback UI in the meantime. Use it to improve perceived performance and enable prioritized rendering of critical content over secondary components.

How do I structure TypeScript types for Server Components and client boundaries?

Enforce server and client boundaries using TypeScript's 'use server' and 'use client' directives paired with strict type definitions. This prevents accidental serialization of non-serializable objects, ensures type safety across boundaries, and catches incompatibilities at compile time.

Can I use the use() hook to consume context and promises across server-client boundaries?

The use() hook in React 19 unwraps promises and accesses context in client components, enabling server-rendered data to flow seamlessly into interactive components. It simplifies async data handling compared to earlier patterns and works within Suspense boundaries for integrated loading states.

What form patterns reduce boilerplate in React 19 applications?

useFormState and useFormStatus hooks streamline form handling by binding server actions directly to form elements, eliminating manual state management and event handlers. They automatically track submission status, pending state, and form data, cutting repetitive form logic across your app.