title: Calling ReactDOM.render repeatedly and memory leaks
body: <p>On this <a href="https://facebook.github.io/react/blog/2015/10/01/react-render-and-top-level-api.html" rel="nofollow">React page</a> it says that you manually need to invoke <code>unmountComponentAtNode</code> because:</p>
  
  <blockquote>
    <p>This is important and often forgotten. Forgetting to call
    unmountComponentAtNode will cause your app to leak memory.</p>
  </blockquote>
  
  <p>I have an app that is repeadedly passing properties to a root component and calling <code>ReactDOM.render</code>. Do I need to call <code>unmountComponentAtNode</code> for the container element in order to prevent a "memory leak", whatever that means?</p>
  
  <p>I've tried doing this and noticed that it results in re-mounting of all child components, while calling <code>ReactDOM.render</code> without <code>unmountComponentAtNode</code> seems to do a diff and doesn't mount any child components again. </p>
  
  <p>So is it okay to call <code>ReactDOM.render</code> without <code>unmountComponentAtNode</code>? Will this cause any memory leaks? On <a href="https://facebook.github.io/react/docs/top-level-api.html" rel="nofollow">this page</a> it says under <code>ReactDOM.render</code>:</p>
  
  <blockquote>
    <p>If the ReactElement was previously rendered into container, this will
    perform an update on it and only mutate the DOM as necessary to
    reflect the latest React component.
    ReactDOM.render() controls the contents of the container node you pass
    in. Any existing DOM elements inside are replaced when first called.
    Later calls use React’s DOM diffing algorithm for efficient updates.</p>
  </blockquote>
  
  <p>It doesn't mention any side effects.</p>
  
  <p><strong>EDIT</strong>:
  I did some simple tasks using Chrome where I called <code>ReactDOM.render</code> with 1 simple component 1 million times using with/without <code>unmountComponentAtNode</code>. The page took around 5 seconds to complete without it and froze and consumed 10x (I stopped it because it froze my window) according to Chrome task manager. So not sure what do they mean by preventing memory leaks using <code>unmountComponentAtNode</code> when the evidence shows that using it may CAUSE them.</p>