title: React Components - What is the proper way to create them?
body: <p>I'm learning React and I came across two different ways to create components. One is by <a href="https://facebook.github.io/react/docs/tutorial.html" rel="nofollow">Facebook</a> and the other by <a href="https://github.com/airbnb/javascript/tree/master/react" rel="nofollow">AirBnB</a>. I also saw them in the tutorials I've been watching.</p>
  
  <p>This may be a stupid question, but which one is better?</p>
  
  <p><strong>Facebook:</strong></p>
  
  <pre><code>var React = require("react");
  
  var Component = React.createClass({
      render: function(){
          return (
              &lt;div&gt;{this.props.item}&lt;/div&gt;
          );
      }
  });
  
  module.exports = Component;
  </code></pre>
  
  <p><strong>AirBnB:</strong></p>
  
  <pre><code>import React from "react";
  
  export default class Component extends React.Component {
      render() {
          return (
              &lt;div&gt;{this.props.item}&lt;/div&gt;
          );
      }
  }
  </code></pre>
  
  <p><strong>Disclaimer:</strong> I may have errors in the code, so please forgive me and just focus on the style.</p>