Extracting reusable stateful logic into your own 'use' functions.
A custom hook is just a plain JavaScript function that calls other hooks internally, following the use- naming convention so both React and lint tooling can correctly apply the Rules of Hooks to it. Custom hooks let you extract and share stateful behavior — form handling, data fetching, subscriptions — across components without the wrapper components that HOCs or render props required.
The nuance that's easy to get wrong: a custom hook shares logic, not state. Every component that calls the same custom hook gets its own completely independent instance of whatever state that hook manages — calling useFetch(url) in two different components does not share data between them, unless the hook is deliberately built to read from something external like context or a module-level store.
What you'll walk away knowing