This skill provides expert guidance on using the ahooks React hooks library, covering state, data fetching, performance, and advanced patterns for robust apps.
npx playbooks add skill whinc/my-claude-plugins --skill ahooks
This skill provides comprehensive expertise for the ahooks React hooks library, covering all 76+ hooks with detailed documentation, examples, and best practices.
import { useRequest, useMount, useSetState } from 'ahooks';
const MyComponent = () => {
const { data, loading, error } = useRequest('/api/data');
const [state, setState] = useSetState({ count: 0 });
useMount(() => {
console.log('Component mounted');
});
return <div>{data}</div>;
};
useSetState, useToggle, useBoolean for complex stateuseRequest for API calls with caching, retry, pollinguseDebounce, useThrottle for optimizationuseMount, useUnmount, useUpdateEffect for component lifecycleThis skill organizes hooks into 9 main categories:
State utilities for complex state handling.
See: [state-hooks.md](references/state-hooks.md)
Component lifecycle and effect management.
See: [effect-hooks.md](references/effect-hooks.md)
API calls, pagination, infinite scroll, and data caching.
See: [request-hooks.md](references/request-hooks.md)
Debounce, throttle, memoization, and RAF optimizations.
See: [performance-hooks.md](references/performance-hooks.md)
Event listeners, sizing, scrolling, and UI interactions.
See: [dom-hooks.md](references/dom-hooks.md)
Local storage, session storage, cookies, and URL state.
See: [dom-hooks.md](references/dom-hooks.md)
Network status, visibility, keyboard events, and browser features.
See: [dom-hooks.md](references/dom-hooks.md)
Intervals, timeouts, and countdown utilities.
See: [advanced-hooks.md](references/advanced-hooks.md)
WebSockets, history management, reactive data, and complex patterns.
See: [advanced-hooks.md](references/advanced-hooks.md)
// Most commonly used hooks
import {
useRequest, // Data fetching
useMount, // Component mount
useUnmount, // Component unmount
useSetState, // State management
useDebounce, // Performance
useThrottle, // Performance
useEventListener // DOM events
} from 'ahooks';Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.