title: React Uncaught Reference Error - object/class not defined
body: <p>I'm still completely new to react.  I tried creating in index.html file with the following contents:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;React Tutorial&lt;/title&gt;
      &lt;!-- Not present in the tutorial. Just for basic styling. --&gt;
      &lt;link rel="stylesheet" href="css/base.css" /&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body id="html-body"&gt;
      &lt;div id="content"&gt;&lt;/div&gt;
      &lt;script type="text/babel" src="scripts/box.js"&gt;&lt;/script&gt;
      &lt;script type="text/babel"&gt;
      ReactDOM.render(
        &lt;Box /&gt;,
        document.getElementById('content')
      );
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And in <code>scripts/box.js</code> I have the following code:</p>
  
  <pre><code>var Box = React.createClass({
    render: function() {
      return (
          &lt;h2&gt;Purple Monkey&lt;/h2&gt;
      );
    }
  });
  </code></pre>
  
  <p>When I view index.html in my browser, I get the error <code>Uncaught ReferenceError: Box is not defined</code> .  But when i move the <code>ReactDOM.render</code> line in index.html into the <code>scripts/box.js</code> right after defining the Box class, everything works.</p>
  
  <p>Why can't I execute the <code>ReactDOM.render</code> outside of <code>scripts/box.js</code> ? How do I properly include/require a react component so it can be used by other javascript files?</p>