React tip: useReducer is a better useState, and it's easier to adopt than you may think.

This post is 3 years old — some details may be outdated.

In the React hooks docs, it’s noted like this:

useReducer is usually preferable to useState when you have complex state logic that involves multiple sub-values or when the next state depends on the previous one. useReducer also lets you optimize performance for components that trigger deep updates because you can pass dispatch down instead of callbacks.