4 ms·
I started using React around 0.4 and I would recommend skipping Flux at first (or entirely) and just learning React. I've helped get a lot of people interested
by rubiquity 12y ago
I started using React around 0.4 and I would recommend skipping Flux at first (or entirely) and just learning React. I've helped get a lot of people interested in checking out React and since Flux has come into existence that has tripped up just about every single one of them. Flux is just too much, too soon, and whether you need Flux at all is up for debate.
- teddythetwig 12y agoAgreed, although for a different reason. When you start using React.js in your frontend, you will eventually run into limitations, such as changing data in sibling components. It is good to know what you can and can't do with React. Then you get to experience the magic of Flux, and everything that made you hate React is possible with the combination. It's like eating your vegetables first... then you get the steak!!
- caseywebdev 12y ago> such as changing data in sibling components [Cursors] can help a lot with this problem. As far as sibling/child components know, they own the state, but they're really using immutability helpers to update a larger encompassing state object. [Cursors]: https://github.com/caseywebdev/cursors https://github.com/caseywebdev/cursors
- mercer 12y agoAlternatively, you could use Reflux.js[1] for a simplified Flux-implementation that is probably enough for smaller apps. I use it in combination with React.js, or Ractive.js, depending on my or my client's needs. Ractive.js, which uses mustache templates, is particularly useful if one needs to collaborate with people who cannot use JSX or are wary of it. And it's pretty useful for smaller projects too. [1]: https://github.com/spoike/refluxjs https://github.com/spoike/refluxjs
- rashkov 12y agoThere is actually an html to jsx compiler available [1]. I've had good luck using it against HTML templates that were handed to me by a designer. [1] http://facebook.github.io/react/html-jsx.html http://facebook.github.io/react/html-jsx.html
- mercer 12y agoInteresting. Would make it much easier for me alleviate concerns and be able to use React for projects. Thanks!
- deleted 12y ago[deleted]
- kansface 12y agoI think it would be quite difficult to build a meaningful app with React and not use something Flux-like. My own experience went like this: I started off by putting all state in Elements, because that is what the React docs encourage. Eventually, I needed to persist the state and/or access it outside the element (because it is actual fucking state used for business logic). At that point in time, I tried passing callbacks into the Elements per the docs. Of course, this is ridiculously cumbersome when the element is nested 5 or 6 levels below the entry point. Then, I tried hooking up Backbone models and sucking data out of those but two way data binding turned my code into spaghetti. Enter flux! This was perhaps a week or two of pain we can spare others.