3 ms·
> They didn't emerge from React - but it isn't possible to do React without them. It is 100% possible to build large React apps without redux/flux. There are e
by chrisabrams 6y ago
> They didn't emerge from React - but it isn't possible to do React without them.
It is 100% possible to build large React apps without redux/flux. There are entire ecosystems built around, say Mobx, among many other libraries and tools which don't even follow the flux style patterns.
> The example on the website uses closures to handle component state
I'm not asking about component state; I'm asking how do multiple components access app-wide state. I can't use a singleton for that; how do I know when that singleton is updated? I guess I could use a proxy but I don't want to do that.
> and to let users pick their desired level of complexity.
React is the view layer. It doesn't enforce any type of data layer or state management layer.
- jeswin 6y ago> I can't use a singleton for that; how do I know when that singleton is updated? It's up to the developer to make that decision. An AccountInfo control could be listening to "ACCOUNT_INFO_CHANGE" events (emitted when account info changes), and can subsequently rerender and read off some singleton state. Rerenders are explicit. And like you said, proxies could be another option.
- deleted 6y ago[deleted]