Feedback

react-component-patterns

@hoangnguyen0403 Claim

Basic information

Repository
HoangNguyen0403
Skill
react-component-patterns

About react-component-patterns

Modern React component architecture and composition patterns.

react-component-patterns is an agent skill listed in the AddMCP.net directory, published by HoangNguyen0403. Runtime: TypeScript. License: MIT. The repository has 582 GitHub stars. Source code is hosted on github.com. Related topics: agent, agentic-ai, android, angular, best-practices.

Overview

What is react-component-patterns?


name: React Component Patterns description: Modern React component architecture and composition patterns. metadata: labels: [react, components, composition, patterns] triggers: files: ['/.jsx', '/.tsx'] keywords: [component, props, children, composition, hoc, render-props]


React Component Patterns

**Priority: P0 (CRITICAL)**

Standards for building scalable, maintainable React components.

Implementation Guidelines

  • Function Components: Only hooks. No classes.
  • Composition: Use children prop. Avoid inheritance.
  • Props: Explicit TS interfaces. Destructure in params.
  • Boolean Props: Shorthand <Cmp isVisible /> vs isVisible={true}.
  • Imports: Group: Built-in -> External -> Internal -> Styles.
  • Error Boundaries: Wrap app/features with react-error-boundary.
  • Size: Small (< 250 lines). One component per file.
  • Naming: PascalCase components. use* hooks.
  • Exports: Named exports only.
  • Conditionals: Ternary (Cond ? <A/> : <B/>) over && for rendering consistency.
  • Hoisting: Extract static JSX/Objects outside component to prevent recreation.

Anti-Patterns

  • No Classes: Use hooks.
  • No Prop Drilling: Use Context/Zustand.
  • No Nested Definitions: Define components at top level.
  • No Index Keys: Use stable IDs.
  • No Inline Handlers: Define before return.

Reference & Examples

See [references/patterns.md](references/patterns.md) for Composition, Compound Components, and Render Props examples.

Related Topics

hooks | state-management | performance

Videos

Tutorials, guides, and showcases related to react-component-patterns. The player loads when you press play.

Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬