3 ms·
I am struggling a little with Flux, everyone has their own implementation of it. I mean that is grand, but what does it actually mean for me? Contextless. Than
by Fifer82 10y ago
I am struggling a little with Flux, everyone has their own implementation of it. I mean that is grand, but what does it actually mean for me? Contextless.
Thanks for sharing :)
- AnkhMorporkian 10y agoHonestly, people are just settling on redux. It builds on flux and really is pretty easy to use. Is it the best solution? No idea, but it works and it's quickly becoming the de facto implementation.
- Stenerson 10y agoWhen I was learning Flux I thought this video series[1] was really helpful. That being said, I've switched to Redux now and am much happier for it. If you're into videos I highly recommend Dan's (creator of Redux and on React core team) Egghead series[2]. [1] - https://www.youtube.com/watch?v=Pd6Ub7Ju2RM https://www.youtube.com/watch?v=Pd6Ub7Ju2RM [2] - https://egghead.io/courses/getting-started-with-redux https://egghead.io/courses/getting-started-with-redux
- mparr4 10y agoI second that. Anything by Dan Abramov is worth your time. In addition to being a brilliant dev he's an excellent teacher. The egghead series is fantastic.
- clay_to_n 10y agoDon't implement Flux or Redux until you need it. This is what most React experts keep saying, but there are a ton of entry-level tutorials trying to teach both React concepts and Flux concepts (probably because it's a cool pattern). For most small apps, it's unnecessary. Pass state down as props.
- mparr4 10y agoThis. If your component hierarchy matches your application state hierarchy, don't use flux. If you need to pass pieces of state around to a bunch of different components (like sharing state across views), use flux. My first react application was complicated enough (enterprise analytics application) to require a flux implementation. I went redux and would highly recommend it both due to its ease-of-use and popularity. However, in subsequent applications I haven't needed it and have enjoyed writing vanilla react.
- level 10y agoBut also recognize when you'll need it, before you need it. I'm working on a React Native application without Flux, and it's turned into a massive roadblock because there's no concept of unidirectional data flow. Passing state up, down, and trying to sync it between components has become a mess and has lead to very tightly coupled components.
- rrecuero 10y agoFor more advanced examples, I recommend checking out these great boilerplates https://github.com/erikras/react-redux-universal-hot-example https://github.com/erikras/react-redux-universal-hot-example Universal Web Rendering. React + Redux + Express + ES6 + Webpack https://github.com/este/este https://github.com/este/este For Web & Mobile (React Native, Redux, ES6...).