Built-in Hooks Overview

The Main Hooks

HookUse it toModule
useStatestore a value that updates the UIuseState Hook
useEffectrun side effects: fetch, timers, subscriptionsuseEffect Hook
useContextread shared data without passing propsuseContext Hook
useRefaccess DOM elements / keep a value without re-renderuseRef Hook
useReducermanage complex state with actionsuseReducer Hook
useMemocache an expensive calculationuseMemo Hook
useCallbackcache a function between rendersuseCallback Hook
useLayoutEffectmeasure the DOM before the browser paintsuseLayoutEffect Hook
useId, useTransition, useDeferredValueids, non-urgent updatesOther Hooks
Your own useXyzreuse logic between componentsCustom Hooks