react

Solid

This skill should be used when the user works with React components (.tsx/.jsx), asks about "hooks", "state management", "context providers", "memo optimization", "useEffect", or discusses component composition and rendering performance. Provides patterns for hooks, state, effects, memoization, and React-specific architecture.

Code & Development 17 stars 1 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 79/100

Stars 20%
42
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# React Patterns Reference for React-specific patterns with citations. Sources in `references/sources.md`. ## Iron Law > **COMPOSITION OVER PROPS** [2][4][12] > > Use children and compound components, not prop drilling. If a component has >5 props, > it's doing too much. Split it. If you're passing data through 3+ levels, use context > or composition. Props are for configuration, not data plumbing. > "Before You memo(), try solving it with composition." — Dan Abramov [4] ## When This Skill Activates - Working with React codebases (.tsx, .jsx) — components, hooks, contexts, performance --- ## Component Structure [1][2] **Functional component order**: hooks → derived state → handlers → return. [1] **Compound components** share structure through children, not props: [2][4] ```tsx function Card({ children }: { children: React.ReactNode }) { return <div className="card">{children}</div>; } Card.Header = ({ children }: { children: React.ReactNode }) => <div className="card-header">{children}</div>; ``` **Context** for shared state across distant components — eliminates prop drilling: [1][2] ```tsx const AuthContext = createContext<AuthContextValue | null>(null); export function useAuth() { const ctx = useContext(AuthContext); if (!ctx) throw new Error('useAuth must be used within AuthProvider'); return ctx; } ``` --- ## Hooks [3][16][24] Hooks must be called at the **top level** — never inside conditions, loops, or nested functions. [16][24] Effects synchro...

Details

Author
dean0x
Repository
dean0x/devflow
Created
10 months ago
Last Updated
yesterday
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category