← React Beginner Questions - Set 9 Q87

What is the difference between useState and useReducer?

React Beginner Questions - Set 9

Example

const [count, setCount] = useState(0);                       // one value
const [state, dispatch] = useReducer(reducer, { count: 0 });  // many values, named actions

What to notice

← Back to the question list