This skill provides pragmatic patterns for React components.
1. Recommended component structure
Order (top to bottom):
Types (Props)
Hooks/state
Derived values (useMemo where useful)
Handlers (useCallback when passed to children)
Render
2. Props and boundaries
Prefer small Props and explicit types.
Avoid passing "bags of data"; pass exactly what the component needs.
Keep components pure: do not fetch data directly inside presentational components unless that is the design.
3. Composition
Prefer composition over deep prop drilling:
children slots
context providers (sparingly, with clear boundaries)
Keep reusable components in a shared components/ directory; keep domain-specific UI in features/<feature>/.
4. Common anti-patterns
Inline anonymous functions in deep lists without need
Multiple early returns that change layout unpredictably
Doing expensive computation during render without memoization
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: willyu1007-ai-first-template-component-patterns3description: Component Patterns4---56# Component Patterns78This skill provides pragmatic patterns for React components.910---1112## 1. Recommended component structure1314Order (top to bottom):151. Types (`Props`)162. Hooks/state173. Derived values (`useMemo` where useful)184. Handlers (`useCallback` when passed to children)195. Render2021---2223## 2. Props and boundaries2425- Prefer small `Props` and explicit types.26- Avoid passing "bags of data"; pass exactly what the component needs.27- Keep components pure: do not fetch data directly inside presentational components unless that is the design.2829---3031## 3. Composition3233- Prefer composition over deep prop drilling:34 - `children` slots35 - context providers (sparingly, with clear boundaries)36- Keep reusable components in a shared `components/` directory; keep domain-specific UI in `features/<feature>/`.3738---3940## 4. Common anti-patterns4142- Inline anonymous functions in deep lists without need43- Multiple early returns that change layout unpredictably44- Doing expensive computation during render without memoization4546---47> Converted and distributed by [TomeVault](https://tomevault.io/claim/willyu1007) — claim your Tome and manage your conversions.48<!-- tomevault:4.0:skill_md:2026-04-14 -->
Run npx skillmds@latest add tomevault-io/willyu1007-ai-first-template-component-patterns in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Component Patterns It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.