react

Guides React component architecture, hooks, state management, performance, and testing patterns.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/lunaticwithaduck/easytech3d --skill react-lunaticwithaduck
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/lunaticwithaduck/easytech3d/tree/main/.claude/skills/react
Command: npx skills add https://github.com/lunaticwithaduck/easytech3d --skill react-lunaticwithaduck

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React codebases accumulate inconsistent patterns: components mixing server and client logic, useEffect misuse, unnecessary re-renders, and ad-hoc state management. This Skill provides decision trees, pattern catalogs, and reference implementations so React work follows consistent, correct conventions. ## Core Features & Use Cases - Component Architecture Decisions: Decision trees for client vs server components, co-location, splitting large components, and choosing between props, compound components, render props, and polymorphic patterns. - Hooks & State Management Guidance: Rules and anti-patterns for every built-in hook, plus decision trees for choosing between useState, Zustand, TanStack Query, URL state, and React Hook Form. - Performance & Testing Patterns: Re-render cause tables, memoization strategies, virtualization, code splitting, and React Testing Library query-priority guidance. - Use Case: When building a data-driven dashboard page, use this Skill to structure the page as a thin orchestrator with a render-state discriminant switch, TanStack Query hooks with a query key factory, and accessible form components validated with Zod. ## Quick Start Use the react skill to refactor this component by extracting its data fetching into a TanStack Query custom hook and splitting its render states into separate components.

Frequently Asked Questions about react

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide between client and server components in React?▼

Use a client component with the 'use client' directive when the component needs browser APIs, event handlers, or local state. Default to server components in the App Router and fetch server data there, passing results down as props.

When should I use Zustand vs TanStack Query for state management?▼

Use Zustand for shared UI state like sidebar visibility or theme, selecting slices with selectors to avoid re-renders. Use TanStack Query for server and async state since it provides caching, background refresh, and optimistic updates.

Why does my React component re-render too often?▼

Common causes are new object or function props created each render, context value changes, and parent re-renders. Fix them with useMemo or useCallback for props passed to memoized children, split contexts, or restructure with composition.

Should I use useEffect for data fetching in React?▼

No, useEffect for fetching lacks loading states, caching, and race-condition handling. Use TanStack Query or framework data fetching instead, and reserve useEffect for syncing with external systems like subscriptions and timers.

How do I test React components with React Testing Library?▼

Test behavior rather than implementation by querying elements with getByRole first, then getByLabelText or getByText, using getByTestId only as a last resort. Drive interactions with userEvent and assert on visible output.

When should I not use useMemo or useCallback?▼

Skip memoization for cheap computations and functions not passed to memoized children, since the overhead exceeds the benefit. Apply them only when children are wrapped in React.memo or values serve as effect dependencies.