title: Call ReactDOM.render in parent component `componentDidMount` lifecycle
body: <p>I am just curious about this. I write a demo below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class ChildComponent extends React.Component{
      componentWillMount() {
          console.log('ChildComponent will mount');
      }
      componentDidMount() {
          console.log('ChildComponent did mount');
      }
      render() {
          console.count('ChildComponent render');
          return &lt;div&gt;
              ChildComponent
          &lt;/div&gt;
      }
  }
  
  class ParentComponent extends React.Component{
      componentWillMount() {
          console.log('ParentComponent will mount');
      }
      componentDidMount() {
          console.log('ParentComponent did mount')
          ReactDOM.render(
              &lt;ChildComponent/&gt;,
              document.getElementById('content')
          )
      }
      render() {
          console.count('ParentComponent render');
          return &lt;div id='parent'&gt;
              ParentComponent
              &lt;div id='content'&gt;&lt;/div&gt;
          &lt;/div&gt;
      }
  }
  
  ReactDOM.render(
    &lt;ParentComponent /&gt;,
    document.body
  )</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>//normal way:
  //ParentComponent will mount
  //ParentComponent render: 1
  //ChildComponent will mount
  //ChildComponent render: 1
  //ChildComponent did mount
  //ParentComponent did mount
  
  //ReactDOM.render way:
  //ParentComponent will mount
  //ParentComponent render: 1
  //ParentComponent did mount
  //ChildComponent will mount
  //ChildComponent render: 1
  //ChildComponent did mount
  </code></pre>
  
  <p>It seems works! But I found the difference between the two ways. The lifecycle executes order is different. But, is there any other difference? I mean, maybe there is a case that the <code>ReactDOM.render</code> the way will cause trouble or error.</p>
  
  <p>I also found that if you inspect the element in browser use development tools, you will find that the <code>data-reactroot</code> property both in <code>ParentComponent</code> and <code>ChildComponent</code> root node. And the normal render way, it just disappears in <code>ParentComponent</code> root node.</p>