react-expert

Solid

React gotchas and decision criteria covering stale closure bugs in useEffect, conditional rendering traps (falsy 0/empty string), state management selection (useState vs Context vs Zustand vs TanStack Query), and hooks rules. Use when writing React components, debugging re-renders, choosing state management, or encountering useEffect infinite loops.

AI & Automation 24 stars 3 forks Updated today MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
47
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
67
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

> **AI-consumed reference.** Optimized for Claude to read during execution. > Human-readable explanation: see [docs/architecture/HIERARCHICAL_PLANNING.md](../../../docs/architecture/HIERARCHICAL_PLANNING.md) > or [docs/getting-started/](../../../docs/getting-started/) depending on topic. # React Expert — Gotchas & Decisions Use Context7 for full React docs. ## Key Decisions ```toon decisions[5]{type,solution}: Component-specific UI,useState Shared between siblings,Lift to parent Theme/auth/deep props,"Context + useMemo value + throw-if-outside-provider" API/server data,TanStack Query or SWR Complex global state,Zustand or Redux Toolkit ``` ## Gotchas - `{count && <X/>}` renders "0" when count=0 — use `{count > 0 && <X/>}` - `{title && <X/>}` renders empty string — use `{title != null && title !== '' && <X/>}` - Keys: unique IDs only, NEVER array indices (breaks on reorder/delete) - useEffect with object/array deps → infinite loop. Destructure or useMemo the dep - useEffect cleanup: return AbortController abort for async fetches - useMemo/useCallback: only for expensive ops or stable refs to memoized children. Don't wrap everything - Context: always `useMemo` the value object to prevent re-renders on every parent render - Error boundaries: class component only (no hook equivalent yet). Wrap at route level

Details

Author
nguyenthienthanh
Repository
nguyenthienthanh/aura-frog
Created
8 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category