title: Remove a child component from parent dom node in react
body: <p>Unmount components from the same DOM element that mounted them in.</p>
  
  <pre><code>ReactDOM.render(&lt;SampleComponent /&gt;, document.getElementById('container'));
  </code></pre>
  
  <p>Then we would unmount it with:</p>
  
  <pre><code>React.unmountComponentAtNode(document.getElementById('container'));
  </code></pre>
  
  <p>How to unmount and reattach a component to parent container if container has two or more than two components attached to it e.g.</p>
  
  <pre><code>&lt;div id="container"&gt;
     &lt;SampleComponent1/&gt;
     &lt;SampleComponent2/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to remove and re-attach the <code>SampleComponent2</code> based on some event from <code>SampleComponent2</code>.</p>