DEV Community

Discussion on: Using useContext and useState hooks as a store

Collapse
 
ascotto profile image
Andrea Scotto Di Minico • Edited

@nazmifeeroz nice approach on how to decouple multiple stores with useState, I had a similar approach but instead used reducers in a similar way as Redux.

As you metioned @pazsea , with useState get complicated quickly.

As I was solving similar issues in the past, recently I wrote a tutorial on how to use Context and that code is decoupled with similar structure as Redux you can have a look here: frontendbyte.com/how-to-use-react-...

Of course I would be happy to know if it was helpful too.

Cheers,
Andrea