Hacker News new | ask | show | jobs
by paol 3524 days ago
> Redux reinforces that the majority of your app should effectively be (props) => JSX

Sure, Redux strongly recommends that practise - and it's a good one - but nothing about it is specific to redux. You can factor your components in the same way with mobx, or with plain React for that matter.

The point of redux and alternatives is to remove state management from inside the components to a dedicated store. Redux doesn't feel natural to me because it does it in a round-about way, introducing more concepts than necessary for the job at hand. Then the responsibility for managing the store is scattered around the reducers, the actions and for anything not completely trivial, some middleware magic for good measure. The glue code between Redux and the components is slightly awkward as well.

Mobx just goes: a store is just a class with properties and methods. Done. Glue code? Wrap the component with a one-line decorator. Done.

1 comments

In my mind there's very high value in the fact that deviating from that is _difficult_ with Redux. Not only does it keep me honest but if a junior dev jumps into my codebase it's actually work for him to do something sketchy with how he's controlling state.