DEV Community

Discussion on: Let's talk React - How to use a Custom Hook multiple times

Collapse
 
ccreusat profile image
Clément Creusat

You're totally right. If a custom hook is more complex, we definitely need to re-think it with useReducer.
Here we have a state and two methods (three with your example and the reset method).. but if the custom hook has x methods better to switch to the useReducer approach.