React · Middle · Question 56 of 75
What makes a good custom hook?
- ✓Correct answer: It extracts reusable stateful logic with a clear purpose, e.g.
useOnlineStatus, and each call has its own state - 2It wraps a single
useEffectnameduseMount - 3It shares state between all components that call it
Explanation
Custom hooks share logic, not state. Names describing lifecycle (useMount) hide intent; prefer names describing what the hook does for the component.