react-hook-authoring

Installation
SKILL.md

React Hook Authoring

Principles for building custom hooks in React 19 component libraries. Optimized for consumer DX — developers using the hooks should not need to think about memoization.

Core Principle

Start without memoization. Add it only when the profiler shows a problem.

The default hook returns plain functions recreated each render. This is correct, simple, and sufficient for the vast majority of cases. Stability is the consumer's responsibility where needed (e.g. useMemo on context value).

Decision Tree

Writing a custom hook that returns functions?
├─ Default: no useCallback, no useRef, no useMemo
│  (Approach A — see references/approaches.md)
├─ Does setValue go into a context with many consumers
Related skills

More from b4r7x/agent-skills

Installs
10
First Seen
Mar 17, 2026