0xbigboss avatar

React Best Practices

Load this when you're touching React components and want to avoid the most common pitfalls, especially overusing useEffect. It treats effects as escape hatches for external systems only and walks you through a decision tree for hooks, refs, and state management. The guidance on when NOT to use effects (derived state, expensive calculations, prop-driven resets) is honestly more valuable than the when-to-use part. Pair it with the TypeScript skill since most modern React is typed. Also covers component composition patterns and has specific advice against building config-driven mini-frameworks when plain JSX would do.

skills.sh installs
3K
GitHub stars
51
last updated
Jul 14, 2026

Install

$ npx -y skills add 0xbigboss/claude-code --skill react-best-practices --agent claude-code

Installs into .claude/skills of the current project.

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

  1. Need to respond to user interaction? Use event handler
  2. Need computed value from props/state? Calculate during render
  3. Need cached expensive calculation? Use useMemo
  4. Need to reset state on prop change? Use key prop
  5. Need to synchronize with external system? Use Effect with cleanup
  6. Need non-reactive code in Effect? Use useEffectEvent
  7. 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).

Sponsors

Details

Repository
github.com/0xbigboss/claude-code
Category
Frontend Development
First seen
May 16, 2026

More from 0xbigboss/claude-code

All 22
1sickn33 avatarui-ux-pro-maxsickn33/antigravity-awesome-skillsui ux pro max2.8Kskills.sh installs
2vercel-labs avatarreact-pdfvercel-labs/json-renderReact PDF renderer for json-render. Use when generating PDF documents from JSON specs, working with @json-render/react-pdf, or rendering specs to PDF buffers/st2.4Kskills.sh installs
3sergiodxa avatarfrontend-testing-best-practicessergiodxa/agent-skillsTesting best practices for the frontend. Emphasizes E2E tests over unit tests, minimal mocking, and testing behavior over implementation details. Use when writi2.2Kskills.sh installs
4getsentry avatarsentry-svelte-sdkgetsentry/sentry-for-aiFull Sentry SDK setup for Svelte and SvelteKit. Use when asked to "add Sentry to Svelte", "add Sentry to SvelteKit", "install @sentry/sveltekit", or configure e2.2Kskills.sh installs
5patternsdev avatarreact-2026patternsdev/skillsProvides a comprehensive guide to the modern React 2026 stack. Use when starting a new React project or modernizing an existing one with current frameworks, bui2.1Kskills.sh installs
6aradotso avatarui-ux-pro-max-skillaradotso/trending-skillsui ux pro max skill1.9Kskills.sh installs