useState
is typically simpler at first than useReducer
(you can even implement useState
using useReducer
), but there's one scenario where useReducer
is almost certainly better than useState
:
When one element of your state relies on the value of another element of your state in order to update:
useReducer
This is based on my blog post: Should I useState or useReducer?
And don't miss When to useState instead of useReducer