title: Where to put ReactDOM.render in React
body: <p>Here is the <a href="https://facebook.github.io/react/docs/getting-started.html" rel="noreferrer">Getting Started</a> example of react, in the example, the bellow code fragment is in separate <strong>main.js</strong> file: </p>
  
  <pre><code>ReactDOM.render(
    &lt;h1&gt;Hello, world!&lt;/h1&gt;,
    document.getElementById('example')
  );
  </code></pre>
  
  <p>What if there are pages that don't contain id: 'example', e.g. home.html(only have id:example1), index.html(only have id:example2), then how to reuse <code>&lt;h1&gt;Hello, world!&lt;/h1&gt;</code> in those pages ?</p>