Skip to content
StackPractices

Tag: react

Browse 18 practical software engineering resources tagged with "react". Discover code recipes, design patterns, documentation templates, and in-depth guides to help you build, deploy, and maintain production-ready solutions involving react.

Form Validation with react-hook-form and Zod

How to build type-safe forms in React using react-hook-form with Zod schema validation, including nested fields, async validation, and dynamic fields.

When to Use useMemo and useCallback

How and when to use React's useMemo and useCallback hooks for performance optimization, and when they add unnecessary overhead.

Virtualize Long Lists with react-window

How to render large lists efficiently in React using react-window for DOM virtualization, including fixed and variable height rows and grid layouts.

SPA Performance: Code Splitting and Lazy Loading

Improve single-page application load times by splitting bundles at route and component level, implementing lazy loading with React.lazy and live imports

Vitest Snapshot Testing for React

How to use Vitest snapshot testing to catch unintended UI changes in React components, including inline snapshots and snapshot updating workflows.

Snapshot Testing React Components with Jest

How to use Jest snapshot testing to catch unintended UI regressions in React components and prevent visual bugs from reaching production

Composite Pattern for UI Component Trees in React

Use the Composite pattern to compose objects into tree structures, letting clients treat individual objects and compositions uniformly in UI component hierarchies

Container-Presenter: Separate Data Logic from Rendering

How to separate data-fetching logic from rendering in React using the container-presenter pattern. Covers hooks migration, testing benefits, and trade-offs.

Custom Hook Composition

How to compose reusable logic with custom React hooks. Covers hook composition patterns, dependency arrays, context integration, and testing strategies.

Optimistic Update: Update UI Immediately, Reconcile on

How to update UI immediately and reconcile on server response in React. Covers rollback on error, conflict resolution, and React Query integration.

State Machine UI: Finite State Machines for UI

How to model UI state transitions with finite state machines in React. Covers XState, statecharts, guarded transitions, and preventing impossible states.

Suspense Boundary: Declarative Loading States with React

How to use React Suspense boundaries for declarative loading states. Covers data fetching, streaming SSR, nested boundaries, and error boundaries.

Complete Guide to AI Agents in Production

Build production AI agents. Covers agent architectures, tool use, planning, memory, multi-agent systems, ReAct patterns, function calling, human-in-the-loop, safety, and deployment patterns for reliable autonomous agents.

Complete Guide to React 19 Features

Master React 19 features. Covers server components, use() hook, actions, form actions, useActionState, useOptimistic, useFormStatus, ref as prop, document metadata, asset loading, and React Compiler with practical code examples.

Complete Guide to React Performance Optimization

Optimize React apps for speed. Covers memoization, virtualization, code splitting, bundle analysis, React Profiler, concurrent features, and Core Web Vitals.

Complete Guide to React Server Components: RSC Architecture

Master React Server Components: RSC architecture, data loading, streaming, server actions, and client component boundaries in Next.js App Router.

React State Management: Context, Zustand, TanStack Query

Master React state management: Context API, Zustand, Jotai, and TanStack Query for server state. Covers patterns, persistence, optimistic updates, and when to use each.

Vitest for React: Component, Hook, and Integration Testing

Master Vitest for React testing: component tests with Testing Library, hook tests with renderHook, integration tests, mocking, snapshot testing, and parallel execution.