react

📁 pproenca/dot-skills 📅 Jan 22, 2026
74
总安装量
74
周安装量
#3006
全站排名
安装命令
npx skills add https://github.com/pproenca/dot-skills --skill react

Agent 安装分布

claude-code 57
opencode 54
codex 54
gemini-cli 51
antigravity 38

Skill 文档

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 Rendering — CRITICAL
  2. Server Components — CRITICAL
  3. Actions & Forms — HIGH
  4. Data Fetching — HIGH
  5. State Management — MEDIUM-HIGH
  6. Memoization & Performance — MEDIUM
  7. Effects & Events — MEDIUM
  8. Component Patterns — LOW-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