← React Intermediate Questions - Set 3 Q27

What is the difference between `useState` and `useReducer`?

React Intermediate Questions - Set 3

Example

useState: one value, setter.
useReducer: a reducer function plus dispatch, better when transitions are named or depend on several fields.

What to notice

← Back to the question list