react

SKILL.md

React 19 Best Practices

Comprehensive performance optimization guide for React 19/19.2 applications. Contains 41 rules across 8 categories, prioritized by impact from critical (concurrent rendering, server components) to incremental (component patterns).

When to Apply

  • Writing new React components or refactoring existing ones
  • Optimizing re-render performance or bundle size
  • Using concurrent features (useTransition, useDeferredValue, Activity)
  • Setting up Server Components or server/client boundaries
  • Implementing form actions, optimistic updates, or data fetching
  • Configuring React Compiler for automatic memoization
  • Reviewing React code for common anti-patterns

Rule Categories

Category Impact Rules Key Topics
Concurrent Rendering CRITICAL 6 useTransition, useDeferredValue, Activity, batching
Server Components CRITICAL 6 RSC boundaries, data fetching, streaming
Actions & Forms HIGH 5 Form actions, useActionState, useOptimistic
Data Fetching HIGH 5 use() hook, cache(), Suspense, error boundaries
State Management MEDIUM-HIGH 5 Derived values, context optimization, useReducer
Memoization & Performance MEDIUM 5 React Compiler, useMemo, useCallback, React.memo
Effects & Events MEDIUM 5 useEffectEvent, cleanup, external stores
Component Patterns LOW-MEDIUM 4 Composition, controlled vs uncontrolled, key reset

Quick Reference

Critical patterns — get these right first:

  • Fetch data in Server Components, not Client Components
  • Push 'use client' boundaries as low as possible
  • Use startTransition for expensive non-blocking updates
  • Use <Activity> to preserve state across tab/page switches

Common mistakes — avoid these anti-patterns:

  • Creating promises inside Client Components for use() (causes infinite loops)
  • Memoizing everything (use React Compiler v1.0+ instead)
  • Using effects for derived state or user event handling
  • Placing 'use client' too high in the component tree

Table of Contents

  1. Concurrent RenderingCRITICAL
  2. Server ComponentsCRITICAL
  3. Actions & FormsHIGH
  4. Data FetchingHIGH
  5. State ManagementMEDIUM-HIGH
  6. Memoization & PerformanceMEDIUM
  7. Effects & EventsMEDIUM
  8. Component PatternsLOW-MEDIUM

References

  1. https://react.dev
  2. https://react.dev/blog/2024/12/05/react-19
  3. https://react.dev/blog/2025/10/01/react-19-2
  4. https://react.dev/blog/2025/10/07/react-compiler-1
  5. https://react.dev/learn/you-might-not-need-an-effect
  6. https://github.com/facebook/react

Related Skills

  • For Next.js 16 App Router, see nextjs-16-app-router skill
  • For client-side form handling, see react-hook-form skill
  • For data caching with TanStack Query, see tanstack-query skill
Weekly Installs
135
GitHub Stars
71
First Seen
Jan 22, 2026
Installed on
codex112
opencode111
gemini-cli109
github-copilot101
claude-code100
cursor88