If you enjoy this approach, you might enjoy the Crank JS framework. https://crank.js.org/
> Crank uses generator functions to define stateful components. You store state in local variables, and `yield` rather than `return` to keep it around.
I started experimenting with this recently. Neither my knowledge nor the maturity is at a level where I would use it for production work but there are definitely some promising aspects to this. I am preparing a talk about it.
The most significant unknown for me is how state management (like Redux etc.) would work in a larger app. I can think of many solutions but I can't figure out whether the tradeoffs then result in a net gain or loss.
I love this for some reason. However, I wonder if it would end up being more complicated than React in practice. I generally prefer pedantic/stricter usage guidelines/conventions.
> Crank uses generator functions to define stateful components. You store state in local variables, and `yield` rather than `return` to keep it around.