Understanding the React useReducer Hook

1 · · Nov. 27, 2019, midnight
Summary
If you are at all familiar with reducers, you should have a good understanding of what React’s useReducer hook does. Plain and simple, it allows functional components in React access to reducer functions from your state management. If you are not familiar with reducers, read this Reducers Introduction first. The basic set up of the useReducer hook is the following: const [state, dispatch] = useReducer(reducer, initialState); Example Store Let’s look at an example using a reducer. It always star...