DEV Community

Discussion on: Wisely Designing your React Components

Collapse
 
mbarzeev profile image
Matti Bar-Zeev

Great question actually :)
As a matter of a fact I used the reducer to obtain control on the setCursor and do some validation for it (you can read more about it in details here: dev.to/mbarzeev/creating-a-react-c...)
After the comments here I went a little bit deeper and saw that it can also be done with useState (still not in the most elegant manner), and I updated my hooks package accordingly.
Thanks for the feedback!