react-hooks
Installation
SKILL.md
When to use this skill
Use this skill whenever the user wants to:
- Use built-in React hooks (useState, useEffect, useContext, useRef, useMemo, useCallback)
- Create custom hooks for reusable stateful logic
- Manage complex state with useReducer
- Optimize component performance with memoization hooks
- Handle side effects (data fetching, subscriptions, timers) with useEffect
- Understand and follow the Rules of Hooks
How to use this skill
Workflow
- Identify which hook best fits the user's requirement
- Apply the Rules of Hooks: only call hooks at the top level; only call hooks from React functions
- Generate hook code with proper dependency arrays and cleanup functions
- Verify there are no stale closures or missing dependencies