ClaudeReactArchitecture

React Claude Rules

Claude rules for React: component design, state patterns, performance, and testing conventions in CLAUDE.md.

CLAUDE.md
- Prefer small, focused components; refactor when a component does more than one thing
- Use React Server Components for data fetching; client components only for interactivity
- Model all async state with useQuery or useAction; avoid manual loading/error state
- Use URL state (searchParams) for shareable, bookmark-friendly filters and pagination
- Write React Testing Library tests for all user-facing components
- Use Storybook for component documentation and visual regression testing
- Avoid prop drilling beyond 2 levels; use context or state management
- Use React DevTools Profiler to identify and fix unnecessary re-renders

How to use with Claude

Create a `CLAUDE.md` file in your project root. Claude Code reads this on startup and follows your conventions throughout the session.

#react#claude#components#testing#coding-rules

Related Rules