react-patterns

Guide React 18+ projects through hooks, component patterns, and performance optimizations.

61|15|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/manutej/luxor-claude-marketplace --skill react-patterns-manutej
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-patterns
Source: https://github.com/manutej/luxor-claude-marketplace/tree/main/plugins/luxor-frontend-essentials/skills/react-patterns
Command: npx skills add https://github.com/manutej/luxor-claude-marketplace --skill react-patterns-manutej

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill offers React design patterns, hooks, and component composition techniques for scalable front-end apps.

Core Features & Use Cases

  • Hooks & State Management: useState, useReducer, useContext patterns.
  • Component Patterns: Compound components, render props, HOCs.
  • Performance: Memoization, code splitting, virtualization.
  • Server Components: Server vs Client component patterns.

Quick Start

Build a small counter with a custom hook and context-based state management.

Frequently Asked Questions about react-patterns

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

FAQPage Schema
How do I structure React components using modern patterns and hooks?

Modern React patterns use functional components with hooks like useState, useContext, and useReducer for state management. Compound components, render props, and HOCs organize component logic for reusability. Server Components separate server and client rendering concerns, optimizing performance and bundle size in React 18+.

What's the best way to manage state in a React application?

State management in React depends on scope: useState for local component state, useContext for shared context across components, and useReducer for complex state transitions. For larger apps, patterns like compound components and container/presenter separation maintain scalability while keeping code maintainable.

How do I optimize React app performance with code splitting and memoization?

Code splitting divides your bundle into smaller chunks loaded on demand, reducing initial load time. Memoization caches component renders and expensive computations to prevent unnecessary recalculations. Virtualization renders only visible list items, essential for handling large datasets efficiently.

When should I use Server Components instead of client-side components?

Server Components execute on the server, reducing client-side JavaScript and enabling direct database access without APIs. Use them for data fetching, form handling, and sensitive operations. Client components handle interactivity. React 18+ patterns guide when to split responsibilities between server and client.

Can I use render props and HOCs alongside hooks in React 18?

Yes. Hooks, render props, HOCs, and compound components coexist in React 18+. Hooks are the modern approach for most cases, but render props and HOCs remain valid patterns for specific scenarios like cross-cutting concerns or library design. Choose based on component complexity and reusability needs.

What's the difference between compound components and container/presenter patterns?

Compound components group related elements with shared internal state and a cohesive API—like form controls working together. Container/presenter (smart/dumb) separates data-fetching logic from UI rendering. Both enable scalable, maintainable code; compound components offer tighter coupling, while container/presenter provides clearer separation.