react
SKILL.md
React Best Practices
Official React 18/19 guidelines - Hooks, Server Components, Performance, Patterns
Core Principles
- ALWAYS Use Hooks - Functional components with hooks over class components
- Server Components by Default - Client components only when needed ("use client")
- Proper Dependencies - Always specify correct dependency arrays
- Cleanup Effects - Return cleanup functions from useEffect
- Avoid Premature Optimization - Use React.memo, useMemo, useCallback wisely
React Hooks - Complete Guide
useState - State Management
✅ Good: Basic useState Patterns
import { useState } from 'react'