Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From Backbone.Views To ReactJs

From Backbone.Views To ReactJs

Sarmad Sangi

April 28, 2014
Tweet

More Decks by Sarmad Sangi

Other Decks in Programming

Transcript

  1. Problem with backbone views • Nested Backbone.View 's are hard

    to maintain (ie lifecycle). • Every time collection changes it re-renders all the views.
  2. What is ReactJs ? • JS Lib for building UI

    Components • Virtual DOM for ultra-high performance
  3. Who is using it ? • Facebook (comments, like etc)

    • Instagram (Main Page) • Khan Academy (200 components)
  4. React Components React.createClass({ render: function () { return React.DOM.div({}, Everything

    is awesome!); } }); OR //jsx lah React.createClass({ render: function () { return <div>Everything is awesome!</div>; } });
  5. React Tips • class -> className • Elements within render

    must have parent element • Don't use minified version in development env • Data flows from parent to child • Move component by component, both backbone views and react components can co-exist in one app.