What problem does it solve?
This skill helps developers write idiomatic React by enforcing proper lifecycle usage, rendering purity, and correct hook choices to avoid common anti-patterns.
Core Features & Use Cases
- Renders must be pure: no side effects during render; derived values should be computed in render or in handlers.
- Effects are for external synchronization: useEffect and useRef for external APIs, subscriptions, and DOM interactions; avoid deriving state inside effects.
- Lifecycle discipline: mount, update, unmount with cleanup functions to avoid leaks.
- Hook guidance: choose the right hook (useState, useEffect, useRef, useMemo, useCallback) and apply them to stabilize performance and readability.
- Use case: apply to writing or reviewing components, fixing hook-related lint errors, and deciding where logic should live (render vs effect vs handler).
Quick Start
Create a small React component that uses useEffect to fetch data and useMemo to compute a derived value.