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

The React Approach for Building Apps

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

The React Approach for Building Apps

Avatar for Ricardo Soares

Ricardo Soares

March 08, 2016

More Decks by Ricardo Soares

Other Decks in Programming

Transcript

  1. It’s all about perspective - BackboneJS is a lightweight MV*

    library - AngularJS focus on extending HTML - EmberJS is more imperative - ReactJS sets a functional design pattern - VueJS prefers the “visual” separation of concerns
  2. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA
  3. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA onprogress
  4. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA onprogress onload
  5. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA onprogress onload onerror
  6. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA onprogress onload onerror ...
  7. Sometimes tradition is hard to deal JavaScript onclick onfocus onchange

    ... UI ... updateC() updateB() updateA() DATA onprogress onload onerror ... MUCH STATE!
  8. The problem - Deal with the DOM stateful nature -

    Seamlessly react to actions/events - Eventually apply updates to the real DOM (and maintain performance)
  9. Virtual DOM A N C B Virtual DOM ... DOM

    Successive renders Updates
  10. Recap - Lots of different approaches out there - Some

    have more opinionated than others - DOM is stateful and JS is not reactive - React approach: a Virtual DOM - React was built for simplicity