react
PyModel/react-frontend-skills/skills/react/SKILL.md
Current React 19.3 guidance for concurrent rendering, Server Components, Actions, effects, React Compiler, View Transitions, state, and memoization. Use for React components and hooks. Next.js-specific routing/caching belongs to the nextjs skill; React Hook Form integration belongs to react-hook-form.
Skill23 starsChanged 14 days ago
What's in it
- React 19 Best Practices
- Table of Contents
- References
- Related Skills
--- name: react description: Current React 19.3 guidance for concurrent rendering, Server Components, Actions, effects, React Compiler, View Transitions, state, and memoization. Use for React components and hooks. Next.js-specific routing/caching belongs to the nextjs skill; React Hook Form integration belongs to react-hook-form. --- # React 19 Best Practices Comprehensive performance optimization guide for React 19 applications. Contains 43 rules across 8 categories, prioritized by impact from critical (concurrent rendering, server components) to incremental (component patterns). Covers the React 19.3 stabilizations: `<ViewTransition>`, Fragment refs, and direct Context providers in Server Components. ## Table of Contents 1. [Concurrent Rendering](references/_sections.md#1-concurrent-rendering) — **CRITICAL** - 1.1 [Avoid Suspense Fallback Thrashing](references/conc-suspense-fallback.md) — HIGH (prevents flickering, smoother UX) - 1.2 [Leverage Automatic Batching for Fewer Renders](references/conc-automatic-batching.md) — HIGH (fewer renders in heavy updates) - 1.3 [Use useDeferredValue for Derived Expensive Values](references/conc-use-deferred-value.md) — CRITICAL (prevents jank in derived computations) - 1.4 [Use useTransition for Non-Blocking Updates](references/conc-use-transition.md) — CRITICAL (keeps UI responsive during heavy updates) - 1.5 [Write Concurrent-Safe Components](references/conc-concurrent-safe.md) — MEDIUM-HIGH - 1.6 [Animate UI Changes with ViewTransition](references/conc-view-transitions.md) — MEDIUM (native View Transition API animations without manual class juggling) 2. [Server Components](references/_sections.md#2-server-components) — **CRITICAL** - 2.1 [Avoid Client-Only Libraries in Server Components](references/rsc-avoid-client-only-libs.md) — MEDIUM-HIGH - 2.2 [Enable Streaming with Nested Suspense](references/rsc-streaming.md) — MEDIUM-HIGH - 2.3 [Fetch Data in Server Components](references/rsc-data-fetching-server.md) — CRITICAL (less client JS, no client waterfalls) - 2.4 [Minimize Server/Client Boundary Crossings](references/rsc-server-client-boundary.md) — CRITICAL (reduces serialization overhead, smaller bundles) - 2.5 [Pass Only Serializable Props to Client Components](references/rsc-serializable-props.md) — HIGH (prevents runtime errors, ensures correct hydration) - 2.6 [Use Composition to Mix Server and Client Components](references/rsc-composition-pattern.md) — HIGH (maintains server rendering for static content) - 2.7 [Render Context Providers in Server Components](references/rsc-context-provider.md) — LOW-MEDIUM (removes provider-wrapper components from the client tree; 19.3) 3. [Actions & Forms](references/_sections.md#3-actions-&-forms) — **HIGH** - 3.1 [Use Form Actions Instead of onSubmit](references/form-actions.md) — HIGH (progressive enhancement, simpler code) - 3.2 [Use useActionState for Form State Management](references/form-use-action-state.md) — HIGH (declarative form handling, automatic pending states) - 3.3 [Use useFormStatus for Submit Button State](references/form-use-form-status.md) — MEDIUM-HIGH - 3.4 [Use useOptimistic for Instant UI Feedback](references/form-use-optimistic.md) — HIGH (instant perceived response, auto-rollback on failure) - 3.5 [Validate Forms on Server with Actions](references/form-validation.md) — MEDIUM (secure validation, consistent error handling) 4. [Data Fetching](references/_sections.md#4-data-fetching) — **HIGH** - 4.1 [Fetch Data in Parallel with Promise.all](references/data-parallel-fetching.md) — MEDIUM-HIGH - 4.2 [Use cache() for Request Deduplication](references/data-cache-deduplication.md) — HIGH (eliminates duplicate fetches per render) - 4.3 [Use Error Boundaries with Suspense](references/data-error-boundaries.md) — MEDIUM (graceful error recovery, isolated failures) - 4.4 [Use Suspense for Declarative Loading States](references/data-suspense-data-fetching.md) — HIGH (cleaner code, coordinated loading UI) - 4.5 [Use the use() Hook for Promises in Render](references/data-use-hook.md) — HIGH (cleaner async component code, Suspense integration) 5. [State Management](references/_sections.md#5-state-management) — **MEDIUM-HIGH** - 5.1 [Calculate Derived Values During Render](references/rstate-derived-values.md) — MEDIUM (eliminates sync bugs, simpler code) - 5.2 [Split Context to Prevent Unnecessary Re-renders](references/rstate-context-optimization.md) — MEDIUM (reduces re-renders from context changes) - 5.3 [Use Functional State Updates for Derived Values](references/rstate-functional-updates.md) — MEDIUM-HIGH - 5.4 [Use Lazy Initialization for Expensive Initial State](references/rstate-lazy-initialization.md) — MEDIUM-HIGH - 5.5 [Use useReducer for Complex State Logic](references/rstate-use-reducer.md) — MEDIUM (clearer state transitions, easier testing) 6. [Memoization & Performance](references/_sections.md#6-memoization-&-performance) — **MEDIUM** - 6.1 [Avoid Premature Memoization](references/memo-avoid-premature.md) — MEDIUM (memoization has overhead, measure first) - 6.2 [Leverage React Compiler for Automatic Memoization](references/memo-compiler.md) — MEDIUM (automatic optimization, less manual code) - 6.3 [Use React.memo for Expensive Pure Components](references/memo-react-memo.md) — MEDIUM (skips re-render when props unchanged) - 6.4 [Use useCallback for Stable Function References](references/memo-use-callback.md) — MEDIUM (prevents child re-renders from reference changes) - 6.5 [Use useMemo for Expensive Calculations](references/memo-use-memo.md) — MEDIUM (skips expensive recalculation on re-renders) 7. [Effects & Events](references/_sections.md#7-effects-&-events) — **MEDIUM** - 7.1 [Always Clean Up Effect Side Effects](references/effect-cleanup.md) — MEDIUM (prevents memory leaks, stale callbacks) - 7.2 [Avoid Effects for Derived State and User Events](references/effect-avoid-unnecessary.md) — MEDIUM (eliminates sync bugs, simpler code) - 7.3 [Avoid Object and Array Dependencies in Effects](references/effect-object-dependencies.md) — MEDIUM (prevents infinite loops, unnecessary re-runs) - 7.4 [Use useEffectEvent for Non-Reactive Logic](references/effect-use-effect-event.md) — MEDIUM (separates reactive from non-reactive code) - 7.5 [Use useSyncExternalStore for External Subscriptions](references/effect-use-sync-external-store.md) — MEDIUM (correct subscription handling, SSR compatible) 8. [Component Patterns](references/_sections.md#8-component-patterns) — **LOW-MEDIUM** - 8.1 [Choose Controlled vs Uncontrolled Appropriately](references/rcomp-controlled-components.md) — LOW-MEDIUM - 8.2 [Prefer Composition Over Props Explosion](references/rcomp-composition.md) — LOW-MEDIUM - 8.3 [Use Key to Reset Component State](references/rcomp-key-reset.md) — LOW-MEDIUM - 8.4 [Use Render Props for Inversion of Control](references/rcomp-render-props.md) — LOW-MEDIUM - 8.5 [Attach DOM Behavior to Siblings with Fragment Refs](references/rcomp-fragment-refs.md) — LOW-MEDIUM (ref access to child DOM without wrapper elements; stable in 19.3) ## References 1. [https://react.dev](https://react.dev) 2. [https://react.dev/blog/2024/12/05/react-19](https://react.dev/blog/2024/12/05/react-19) 3. [https://react.dev/blog/2025/10/01/react-19-2](https://react.dev/blog/2025/10/01/react-19-2) 4. [https://react.dev/learn/you-might-not-need-an-effect](https://react.dev/learn/you-might-not-need-an-effect) 5. [https://github.com/facebook/react](https://github.com/facebook/react) ## Related Skills - For Next.js 16 App Router, see `nextjs` skill - For client-side form handling, see `react-hook-form` skill - For data caching with TanStack Query, see `tanstack-query` skill
More agent context in PyModel/react-frontend-skills
32 other files this repository gives its agents.
AGENTS.md
- skills/feature-arch/AGENTS.md
- skills/msw/AGENTS.md
- skills/nextjs/AGENTS.md
- skills/nuqs/AGENTS.md
- skills/playwright/AGENTS.md
- skills/react-hook-form/AGENTS.md
- skills/shadcn/AGENTS.md
- skills/tailwind/AGENTS.md
- skills/tanstack-query/AGENTS.md
- skills/tdd/AGENTS.md
- skills/ui-design/AGENTS.md
- skills/vercel-composition-patterns/AGENTS.md
- skills/vercel-react-best-practices/AGENTS.md
- skills/vitest/AGENTS.md
- skills/zod/AGENTS.md
Skill
- feature-archskills/feature-arch/SKILL.md
- mswskills/msw/SKILL.md
- nextjsskills/nextjs/SKILL.md
- nuqsskills/nuqs/SKILL.md
- playwrightskills/playwright/SKILL.md
- react-hook-formskills/react-hook-form/SKILL.md
- shadcnskills/shadcn/SKILL.md
- tailwindskills/tailwind/SKILL.md
- tanstack-queryskills/tanstack-query/SKILL.md
- tddskills/tdd/SKILL.md
- typescriptskills/typescript/SKILL.md
- ui-designskills/ui-design/SKILL.md
- vercel-composition-patternsskills/vercel-composition-patterns/SKILL.md
- vercel-react-best-practicesskills/vercel-react-best-practices/SKILL.md
- vitestskills/vitest/SKILL.md
- web-design-guidelinesskills/web-design-guidelines/SKILL.md
- zodskills/zod/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

