Glossary term
What is useReducer? Meaning for developers
In Senior Frontend Depth
State changed by a pure function (state, action) => state. Good for complex changes.
Learn it properly · Senior Frontend DepthLesson 1: Hooks in Depth: Effects, Refs and the RulesEffect dependencies, stale closures, useRef vs state, useLayoutEffect and the idea behind “You Might Not Need an Effect”.In React in Depth
A pure function (state, action) => newState that keeps all the ways a piece of state can change in one place.
Learn it properly · React in DepthLesson 3: Hooks in Depth: useRef, useMemo, useCallback, useReducer and Custom HooksEach hook with one small reason to use it, the rules of hooks and why they exist, and how to write a custom hook.