
React Best Practices
Decision-tree guide for React components that steers logic away from unnecessary Effects toward render, events, and refs.
- skills.sh installs
- 3K
- GitHub stars
- 49
- last updated
- Jul 14, 2026
Own this skill? Claim it
What it does
- Covers when to use Effects versus event handlers, render-time derivation,
useMemo,keyresets, and refs - Includes rules for refs, custom hooks, and composition patterns such as compound components and Context providers
- Enforces that Effects are reserved for syncing with external systems like WebSockets, IntersectionObserver, and window listeners
- Designed for
.tsxand.jsxfiles with React imports, and meant to be loaded alongsidetypescript-best-practices
Install
$ npx -y skills add alleneubank/claude-code --skill react-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React Best Practices
Pair with TypeScript
When working with React, always load both this skill and typescript-best-practices together. TypeScript patterns (type-first development, discriminated unions, Zod validation) apply to React code.
Core Principle: Effects Are Escape Hatches
Effects let you "step outside" React to synchronize with external systems. Most component logic should NOT use Effects. Before writing an Effect, ask: "Is there a way to do this without an Effect?"
Decision Tree
- Need to respond to user interaction? Use event handler
- Need computed value from props/state? Calculate during render
- Need cached expensive calculation? Use
useMemo - Need to reset state on prop change? Use
keyprop - Need to synchronize with external system? Use Effect with cleanup
- Need non-reactive code in Effect? Use
useEffectEvent - Need mutable value that doesn't trigger render? Use ref
When to Use Effects
Synchronizing with external systems: browser APIs (WebSocket, IntersectionObserver), third-party non-React libraries, window/document event listeners, non-React DOM elements (video, maps).
Details
- Repository
- github.com/alleneubank/claude-code
- Categories
- Frontend & UI Code, Code Review & Quality
- First seen
- May 16, 2026
More from alleneubank/claude-code
All 8Similar to React Best Practices
More Frontend & UI Code
react-useeffectsoftaworks/agent-toolkit4.2K installsReact useEffect guidance that steers away from unneeded Effects toward render-time calculation, event handlers, and key props.
react-patternssickn33/agentic-awesome-skills970 installsModern React guidance covering components, hooks, state, React 19, performance, and TypeScript typing.
frontend-react-best-practicessergiodxa/agent-skills1.2K installsReact performance rules and composition patterns covering re-renders, bundle size, and hydration pitfalls.
hooks-patternpatternsdev/skills1.2K installsReusable React Hooks guide for extracting shared stateful logic, forms, subscriptions, and side effects into custom hooks.
react-composition-patternssecondsky/claude-skills498 installsReact composition patterns that scale for refactoring boolean-prop components and designing flexible, reusable APIs.
react-developmentmanutej/luxor-claude-marketplace470 installsComprehensive React guidance covering hooks, components, state, context, effects, and performance from official docs.