|
|
|
|
|
by knuthsat
2017 days ago
|
|
I think hooks and effects are really good. You can test them separately. You can write global reactions to state changes very easily. I find hooks/effects better than mobx or redux. hooks/effects, redux, mobx would be my preference order. Although redux works so well that it can be used with hooks/effects. For global state I would just use a React.Context with it's own effects. Most components do not have any async effects. I do admit that when jumping into a new codebase with hooks/effects I often find people have just butchered the concept. But I find that when I jump into codebases with mobx and redux too.
The butchering that people do with mobx is much worse, with massive module importing of global stores, misuse of `name?: type` inside stores because they want to initialize the store at a later time. |
|