you-dont-need-react-custom-hooks
You Don't Need React Custom Hooks
Overview
A React custom hook is not the default unit of abstraction; it is the last option. Custom hooks make it easy to add dependencies and side effects, which can give a module too many responsibilities and create tight coupling internally. These hidden dependencies make code harder to trace, so modules that depend on React need stricter responsibility boundaries than ordinary modules.
This skill does not ban custom hooks. Instead, before creating one, first check whether an ordinary module is enough. Use a hook only when its concern, responsibility, role, and dependencies are clear.
When to Use
Use this skill when:
- Evaluating React component or custom hook code
- Designing or implementing a new React component or custom hook
- Refactoring an existing custom hook or extracting a new custom hook from a React component
Do not use this skill when:
More from choegyumin/agent-skills
frontend-layered-architecture
Use when frontend work involves architecture, directory structure, file placement, ownership, imports, dependency direction, API contracts, query logic, URL state, mappers, schemas, hooks, stores, or shared/type-based folders.
6you-dont-need-a-react-custom-hook
Use when React component or custom hook work may involve extracting hooks, changing hook responsibilities, or hiding dependencies behind custom hooks
1you-dont-need-a-react-custom-hooks
Use when React component or custom hook work may involve extracting hooks, changing hook responsibilities, or hiding dependencies behind custom hooks
1