react-patterns

Guide React development with modern patterns, hooks, and TypeScript best practices.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/bennie-ng/AgCel --skill react-patterns-bennie-ng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/bennie-ng/AgCel/tree/main/skills/react-patterns
Command: npx skills add https://github.com/bennie-ng/AgCel --skill react-patterns-bennie-ng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to modern React patterns and best practices, helping developers build robust, scalable, and performant applications.

Core Features & Use Cases

  • Component Design: Learn principles for creating well-structured and maintainable components.
  • Hook Patterns: Understand when and how to extract custom hooks for reusable logic.
  • State Management: Choose the right state management solution for different application complexities.
  • Performance Optimization: Discover techniques to identify and resolve performance bottlenecks.
  • TypeScript Integration: Implement best practices for typing React components and props.
  • Use Case: A developer looking to refactor a complex React component or ensure their new feature adheres to industry-standard patterns would consult this Skill.

Quick Start

Explain the concept of compound components in React.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
What are compound components in React and when should I use them?

Compound components in React are a pattern where multiple components work together implicitly through shared state and context, used when building flexible, composable UI APIs like select dropdowns or tabs that require tight internal coordination without prop drilling.

How do I choose the right state management solution for my React application?

Choosing state management in React depends on application complexity; local component state works for simple UI, while global solutions are needed for complex shared data, balancing server cache, URL state, and persistent client state based on specific scope.

How do I extract custom hooks for reusable logic in React?

Extract custom hooks in React by isolating stateful logic and side effects into reusable functions prefixed with "use", implementing when multiple components share identical data-fetching, formatting, or event-handling behaviors to ensure maintainability.

What are common React anti-patterns to avoid in production applications?

Common React anti-patterns to avoid include prop drilling beyond two levels, overusing Context for high-frequency state changes, deeply nested conditional rendering, and premature performance optimization, which degrade scalability and maintainability.

How do I implement TypeScript best practices for typing React component props?

Implement TypeScript best practices for React props by defining explicit interface types for component inputs, using discriminated unions for polymorphic components, and avoiding the 'any' type to ensure strict type safety and predictable compilation.

What React 19 features improve performance optimization and composition?

React 19 features enhance performance optimization and composition through improved concurrent rendering capabilities, refined server component integration, and optimized hook behaviors that minimize unnecessary re-renders and streamline complex component trees.