react-patterns

Guides React component design, hooks, state management, and TypeScript best practices.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/Eng-suso/BK-GPT --skill react-patterns-eng-suso
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/Eng-suso/BK-GPT/tree/main/.claude/skills/react-patterns
Command: npx skills add https://github.com/Eng-suso/BK-GPT --skill react-patterns-eng-suso

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React codebases often accumulate inconsistent patterns, oversized components, and premature optimizations. This Skill provides a structured reference of modern React principles so you can make consistent decisions about component design, hooks, state management, and performance. ## Core Features & Use Cases - Component Design Guidance: Rules for server, client, presentational, and container components with composition-first principles. - Hooks and State Selection: Decision tables for extracting custom hooks and choosing between useState, Context, React Query, Zustand, or Redux Toolkit. - React 19 and Performance Patterns: Coverage of useActionState, useOptimistic, compiler benefits, error boundaries, and a profile-first optimization workflow. - Use Case: When refactoring a large component with deep prop drilling, consult this Skill to decide whether to lift state, introduce Context, or split into compound components. ## Quick Start Review my React component and suggest improvements based on modern React patterns for hooks, state management, and performance.

Frequently Asked Questions about react-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between Context, Zustand, and Redux for React state management?▼

Choose based on complexity: useState or useReducer for simple local state, Context for shared subtree state, React Query or SWR for server state, and Zustand or Redux Toolkit for complex global state. Match the tool to the scope of the state, not the size of the app.

When should I extract a custom hook in React?▼

Extract a custom hook when the same logic repeats across components, such as localStorage access, debounced values, fetch patterns, or complex form state. Custom hooks must start with "use", be called at the top level, and clean up effects on unmount.

What are the new hooks in React 19?▼

React 19 introduces useActionState for form submission state, useOptimistic for optimistic UI updates, and use for reading resources during render. The React compiler also adds automatic memoization, reducing the need for manual useMemo and useCallback.

How do I fix slow React component rendering?▼

Profile first with React DevTools before optimizing. Virtualize large lists, apply useMemo only to expensive calculations, and use useCallback for stable callback references. Premature optimization without profiling is an anti-pattern.

Where should I place error boundaries in a React app?▼

Place error boundaries at the root for app-wide coverage, at route or feature level for isolated failures, and around individual risky components. Each boundary should show fallback UI, log the error, offer retry, and preserve user data.