React Design Patterns
Advanced React patterns for state management, concurrent rendering, React 19 Actions, and Server Components
Other React Sheets
State Management Patterns
Patterns for managing complex state with reducers, context, and custom hooks
useReducer Pattern
Manage complex state transitions with a reducer function and dispatched actions
Reducer + Context Pattern
Combine useReducer with Context to share complex state across the component tree (Redux-lite)
Custom Hooks Composition
Build complex behavior by composing smaller, focused custom hooks
Concurrent Rendering
Use React concurrent features to keep the UI responsive during expensive updates
useTransition
Mark state updates as non-urgent transitions to keep the UI responsive
useDeferredValue
Defer rendering of expensive UI based on a value while keeping inputs responsive
React 19 Actions & Forms
New form handling pattern with built-in pending state, errors, and optimistic updates
useActionState
Manage form state, errors, and pending status with a single hook
useOptimistic
Show instant UI feedback while async operations are still in flight
useFormStatus & form Actions
Read pending state from a parent form without prop drilling
Server Components
Render components on the server, fetch data directly, and mix with client components
Server Components Basics
Async components that run on the server with direct data access
Server Actions ('use server')
Call server functions directly from client components and forms
Component API Patterns
Patterns for designing flexible and reusable component APIs
Polymorphic Components (as prop)
One component that can render as different elements based on an "as" prop
Controlled vs Uncontrolled
Two ways to manage component state — let parent control, or manage internally
Provider Pattern with Custom Hooks
Wrap context with a Provider component and a custom hook for safe consumption