title: Render a single react component in a html file (webpack)
body: <p>I'm trying to render a simple react component to a html page, but can't figure out how to do it. </p>
  
  <pre><code>// hello.js
  import React from 'react';
  import ReactDOM from 'react-dom';
  
  export default class Hello extends React.Component {
    render() {
      return (
          &lt;h1&gt;Hello {this.props.name}&lt;/h1&gt;
      )
    }
  }
  
  // index.html
  &lt;html&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;head&gt;
  
      &lt;!-- HTML code --&gt;
  
      &lt;!-- RENDER HERE --&gt;
  
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>webpack and babel:</p>
  
  <pre><code>// index.js 
  import Hello from './hello.js'
  </code></pre>
  
  <p>If i put this line at the end of Hello.js:</p>
  
  <pre><code>ReactDOM.render(&lt;Hello/&gt;, document.getElementById('hello'));
  </code></pre>
  
  <p>I can render the component with:</p>
  
  <pre><code>// index.html
  &lt;div id="hello"&gt;&lt;/div&gt;
  &lt;script src="bundle.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>However, There are times where I don't want to render the component, or render it after a certain time interval. If I remove the div i get an error: </p>
  
  <pre><code>Target container is not a DOM element
  </code></pre>
  
  <p>I guess I want to do something like this (Which doesn't work)</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;head&gt;
  
      &lt;!-- HTML code --&gt;
  
      &lt;!-- RENDER HERE --&gt;
      &lt;div id="hello"&gt;&lt;/div&gt;
  
      &lt;script src="bundle.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
          setTimeout(function() {
              ReactDOM.render(&lt;Hello/&gt;, document.getElementById('hello'));
          },1000);
  
          // or 
  
          if (true) {
              ReactDOM.render(&lt;Hello/&gt;, document.getElementById('hello'));
          } 
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What am I doing wrong here? 
  And question nr 2. How do I pass props to the component?</p>