React

Use when building React 18+ (Vite, TypeScript) components, hooks, error boundaries, and layout elements.

SahilKhan30 Updated

File contents

React 18+ & Component Architecture Skill

Purpose

Standardize React component composition, state isolation, hooks, and UI state boundary handling.


1. Core Principles

MANDATORY

  • Use TypeScript functional components with explicit prop interface types.
  • Provide explicit UI state boundaries for:
    1. Loading State: Visual spinner or skeletonloader.
    2. Error State: User-friendly error alert with retry trigger.
    3. Empty State: Clear empty message when datasets contain zero items.
  • Wrap feature trees in React Error Boundaries to catch runtime rendering errors.

MUST NOT

  • Fetch data directly inside useEffect with raw fetch() or Axios (use RTK Query).
  • Store un-paginated large API responses in component local state.

SahilKhan30/claude-skill/tree/main/.claude/skills/frontend/react commit a4899126ea

Frequently asked questions

npx skillmds@latest add sahilkhan30/react