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

Well...

React is just a view layer; it's a way of turning data into DOM nodes. It works fine, and it's a pretty good way of doing so, although it's fairly weak for, say, making a bunch of basic CRUD forms, but very good for making little widgets. Bonus: It's very very composable. And you can make cool things—even those CRUD forms that otherwise seem daunting—by composing components and wrapping it up into a simple <Widget data={data} conf={conf}/> tag.

Strengths of React: declarative, kind of functional-ish, works well with immutable data. If you do it right, your React code is basically just a bunch of pure functions which accept data and turn it into DOM nodes; that makes it easy to reason about, easy to test, east to compose. If you ever look at your app and it looks wrong, troubleshooting it is easy. Put a console.log statement at the top of your render function to print out your props. If it's not run, your render function isn't being called. If it's run with the wrong arguments, a parent is passing in the wrong props. If it's being run with the right props but still looks wrong, you have an error in your render code, fix that.

Even a very, very complex React app boils down to the same reductive approach; start at the top of the tree and follow the data down until you hit the error. Debugging a complex Backbone app, in contrast, can be much more exciting in my experience.

But again, just a view layer. Comparing it to Angular is a bit like comparing Angular to Handlebars. :) You need a lot more to write a real app. Now you can try and hook it up to a Backbone router and Backbone models, but eww, don't do that. Or you can go the Om/Omniscient route with cursors and such. Or, yes, flux.

Flux is a really good pattern too. Redux is probably my choice for top two favourite flux implementations right now, but it's changing fast, still pretty beta, very poorly documented, and definitely aimed at people who already know flux.

I'd actually recommend you look at Marty or Alt. I think Alt might be slightly the better library, but Marty probably has the edge on documentation. Both are very similar and, as a bonus, are in the process of merging. Either would probably be a better choice than Redux if you're new to Flux in general. (I'm using Marty in a project at the moment, and found the documentation pretty helpful.)

I'd also recommend this blog post: http://www.toptal.com/react/navigating-the-react-ecosystem

The Reactiflux community on Slack is also really helpful.



Redux makes a lot of sense to me actually; I'll dig into it again when they've finished the great 1.0 renaming.

Thanks for the reply, much appreciated.




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

Search: