DEV Community

Discussion on: Can React state management get any simpler than this?

Collapse
 
zaydek profile image
Zaydek MG • Edited

Yeah. I’ve been thinking about this pattern myself. If you want to compare notes, here’s my minimalistic store implementation here: github.com/zaydek/retro/blob/go-re....

I think useState is a nice primitive but telling devs to ‘lift state to the parent component’ is actually somewhat of an anti-pattern. I researched Svelte quite a bit and Vue both seem to implement stores, which seem to be largely the same kind of API you are showing off here, if I’m not mistaken.

Thanks for sharing!