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

ReactJS Awesomeness

ReactJS Awesomeness

A quick introduction to ReactJS

Swaroop SM

July 28, 2015
Tweet

More Decks by Swaroop SM

Other Decks in Programming

Transcript

  1. • Born at Facebook. • Lets you build user interfaces.

    • Described as the V in MVC. • Building large applications with data that changes over time. • Actively maintained. • https://github.com/facebook/react
  2. What it does not have? • No Router. • No

    Controllers. • No Models. • No Templates.
  3. React Stuffs • Component • JSX • props • state

    • refs • Virtual DOM • Server-Side Rendering
  4. Component • Elements in view. Eg.: Button Widget, Shopping Cart

    Widget etc. • `React.createClass({ })` • Must override the render method
  5. JSX • A JS syntax extension that looks like XML

    • Can be transformed into JS using React
  6. state • Mutable • Set using `setState` • Access via

    `this.state` • Triggers a render automatically when a state changes
  7. Virtual DOM • Virtual Representation of DOM • Can keep

    track of what has changes in the DOM • Render only the changed parts based on a diffing algorithm • VERY FAST!!!
  8. Server-Side Rendering • Construct React components as an HTML on

    the server-side and render it. • SEO for Free :)