I've done similar. But I don't see any reason for useReducer. useState us sufficient and less clottery, makes it more readable when you don't have to deal with actions.
I agree that a baseline implementation is more readable if implemented with useState. The idea here is that the reducer is ready and waiting if a user requires more complex local state management.
I've done similar. But I don't see any reason for useReducer. useState us sufficient and less clottery, makes it more readable when you don't have to deal with actions.
I agree that a baseline implementation is more readable if implemented with
useState
. The idea here is that the reducer is ready and waiting if a user requires more complex local state management.Sure but most often this will not be required 😊 it's a form of premature optimisation imo. Although it's not an expensive one.