title: React - Cannot load code from an external file
body: <p>I'm trying to learn React and I want to start with the simplest possible example. I got one from here: <a href="https://codeutopia.net/blog/2016/01/10/getting-started-with-react-the-easy-way/" rel="nofollow noreferrer">https://codeutopia.net/blog/2016/01/10/getting-started-with-react-the-easy-way/</a></p>
  
  <p>But the code seems to refuse to load from the external .js file.</p>
  
  <p><strong>reacttest.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react-dom.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div id="app"&gt;&lt;/div&gt;
      &lt;script src="main.js" type="text/babel"&gt;
        // Code omitted to keep sample short
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>var App = React.createClass({
    render: function() {
      return &lt;div&gt;Something something Dark Side&lt;/div&gt;;
    }
  });
  
  ReactDOM.render(
    &lt;App /&gt;,
    document.getElementById('app')
  );
  </code></pre>
  
  <p>If I place the same code inside the script tags then it works fine. What am I doing wrong?</p>