hooks
SKILL.md
Custom Hook Guidelines
This rule outlines the guidelines for creating custom React hooks within this project.
Custom Hooks
- Purpose: Encapsulate reusable stateful logic, especially for data fetching or complex UI interactions.
- Location: Place custom hooks in the
apps/web/hooks/directory. - Naming: Use the
useprefix (e.g.,useAccounts.ts). - Data Fetching: For fetching data from API endpoints, prefer using
useSWR. Follow the guidelines outlined in data-fetching.mdc.- Create dedicated hooks for specific data types (e.g.,
useAccounts,useLabels). - The hook should typically wrap
useSWR, handle the API endpoint URL, and return the data, loading state, error state, and potentially themutatefunction from SWR.
- Create dedicated hooks for specific data types (e.g.,
- Simplicity: Keep hooks focused on a single responsibility.
By adhering to these guidelines, we ensure a consistent approach to reusable logic and data fetching throughout the application.
Weekly Installs
17
Repository
elie222/inbox-zeroGitHub Stars
10.2K
First Seen
Feb 13, 2026
Security Audits
Installed on
amp17
github-copilot17
codex17
kimi-cli17
gemini-cli17
cursor17