Question 8 of 10Pro Only
When would you choose useReducer over useState?
Sample answer preview
Both useState and useReducer manage state in React components, but they suit different scenarios. useState is simpler and works well for independent pieces of state with straightforward updates. Use it for toggles, form inputs, counters, and simple values.
useStateuseReducerreducerdispatchcomplex state