DEV Community

Discussion on: Keeping track of on/off states of React components

Collapse
 
dance2die profile image
Sung M. Kim • Edited

Thank Kushan 👍,

That's a great way to abstract the click state functionality.

I love how each Child component gets to track its own clicked state (after wrapping it with AddClick HoC).

I've also gotten a feedback on Reddit and how someone already created a library react-on-off for such a scenario.

I believe that your HoC version is handy when good-enough is just good enough.