News for hackers. Stuff that matters.
Re:React 16 by acemarke on Tuesday September 26, 2017 @06:48PM (#15343290)
Sure. And please really do feel free to ping me on Reactiflux if you have questions or would like to discuss things.

Redux isn't for everybody or every use case. However, I do think it's frequently misunderstood. If it _really_ isn't helping you solve your problems, then you should certainly use something that's more appropriate or useful. But, it's also entirely possible that a better understanding of how it can be used, or how it can be adapted for certain situations, might make it more useful and helpful for your use case. A lot of my time writing about Redux has been spent trying to help clear up misconceptions, answer questions about real-world usage, and help people better understand how it works and can be used, so that they can make more informed decisions about Redux.

Re:React 16 by longsangstan on Tuesday September 26, 2017 @09:37PM (#15344209)
Do you recommend people to use redux for small scale project for global states? I for example use redux for states like isUserLoggedIn or userName/userId, and not much else. If not what are the alternatives apart from simply passing the state down the component tree? Thanks.
Re:React 16 by acemarke on Tuesday September 26, 2017 @09:53PM (#15344269)
If that's really all you're tracking, then you're probably not going to get much benefit out of Redux. Then again, it's also possible that there wouldn't be much overhead in simply creating a Redux store, inserting a couple values, and connecting components to retrieve those.

Dan's post "The Case for Flux" [0] discusses what kind of use cases would benefit from a Flux architecture. That still very much applies to using Redux as well, and is worth reading. The Redux FAQ also has a section on "When should I use Redux?" [1]

There's nothing _wrong_ with passing down values as props, even through multiple levels - it's just that most people dislike doing so. You could make the values available using React's "context" feature, although it's likely that wouldn't be the best choice here. There's also a variety of "not-quite-Redux" libraries out there that try to simplify the interactions with Redux ("no reducers", "no dispatching", "no actions", etc), and perhaps one of those might be useful.

[0] https://medium.com/swlh/the-case-for-flux-379b7d1982c6

[1] http://redux.js.org/docs/faq/General.html#general-when-to-us...