Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

React is pretty easy to start with, for me the question is when does redux and the madness in redux starter kit become worth it.


Has anyone done anything non-trivial with [MobX](https://github.com/mobxjs/mobx) as an alternative to redux/flux with react?

I'm curious how that ends up working out. It is intriguing and enticing to me, because I have had similar experiences that the most 'challenging' part of using react is the flux part not the actual react part. But I'm just a react newbie, and based on my experience so far, am scared to go 'off the common path' at all because it tends to end up being a royal mess for reasons I didn't have the experience to predict in advance. :)


I faced this same question on a recent small project. For anyone dipping their toes into React, it's a huge leap of complexity. I thought I could jump into Flux just like React: get familiar with the concepts, do a tutorial or two, and start building. Nope.

I looked into Redux, but quickly realized it was overkill for my simple project. I eventually settled on Reflux, and I would highly recommend it for those who are just getting started with Flux.


Yeah, I can see the value in redux for a big app with lots of complex state to manage (eg Facebook), but it seems like major overkill in a lot of smaller apps where people seem to be reaching for it by default for some reason. Plain React components and a few helper modules can get you a surprisingly long way--there's really no need for more framework until deeply nested components make simple argument passing unweildy.


I saw this from Redux's creator that aligns with my take: "When people say setState() is an anti-pattern, they mean 500-line components with a complex setState() soup scattered across event handlers. When you spend your days looking for bugs in those handlers and moving them up and down component hierarchy, consider extracting it." https://twitter.com/dan_abramov/status/725090047557558272

I had that whole 'moving values and events up and down the component hierarchy, driving me nuts' thing going on when I tried to make an editor page for a two-level list. I added Redux and now I just directly read/update the list in the store from every component in the editor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: