Core Hooks for Reacts
Core hooks are the built-in functions that let function components use React features beyond local state. useEffect runs side effects after render, useRef holds a mutable value or DOM node without causing re-renders, and useContext with useReducer shares and manages state across the tree.
Stage: Hooks · Part of the React roadmap · Last reviewed 19 November 2026
What to learn in Core Hooks
- Run a side effect with useEffect and a correct dependency array
- Clean up subscriptions and timers in an effect return function
- Focus an input or read a DOM node using useRef
- Share a value through Context without prop drilling
- Manage multi-step state transitions with useReducer
- Avoid effects for values you can compute during render
Core Hooks interview questions
What does the dependency array of useEffect do?
It lists the reactive values the effect uses. React re-runs the effect after a render only if one of them changed. An empty array runs it once after mount, and omitting it runs after every render.
When would you choose useReducer over useState?
Choose useReducer when state has several related fields or when the next state depends on a named action, such as in a cart or a multi-step form. It centralises update logic in one pure function and is easier to test.
Where Core Hooks fits in the React roadmap
Core Hooks belongs to the Hooks stage (intermediate level), which takes about 25 hours. Side effects and logic reuse.
Other units in this stage
Back to the full React roadmap