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

Does this post answer any of your questions?

http://www.quora.com/Pete-Hunt/Posts/Facebooks-React-vs-Angu...

Declarative syntaxes are easier to work with because you can look at your template and see exactly what the UI will look like. Since you're not doing the DOM manipulation yourself, it's completely airtight and you don't need to worry about writing custom DOM manipulation code for each individual part of the UI that can change. Of course, in any framework you can rerender the entire DOM by setting innerHTML on the top level but that tends to be slow and you need to watch out about resetting scroll position, input focus (and value), etc. React takes care of all of this for you.

(You're right that invalid user input is something you need to deal with regardless, but you should need to deal with that only when making forms, never when displaying data that you already have (which is the common case). As for fallback values, it's easy to write something like

  <div>{this.props.author || "(anonymous)"}</div>
in React when building a view.)


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

Search: