title: In React how to determine when DOM is ready?
body: <p>The method ReactDOM.render has a callback which</p>
  
  <blockquote>
    <p>will be executed after the component is rendered or updated</p>
  </blockquote>
  
  <p>Does this mean when the DOM is ready? (E.g. as in jQuery.ready() )</p>
  
  <p>This becomes an issue when running a selenium test. For example:</p>
  
  <ol>
  <li><p>navigate to url which (using router) will cause a set of components to render </p>
  
  <p>browser.get(url)</p></li>
  <li><p>test for some text on the page</p>
  
  <p>assertTrue 'testword' in browser.page_text</p></li>
  </ol>
  
  <p>The callback is on the outermost (top-level) component. It does seem to wait until all its children are rendered. But - will it be called only when the DOM is rendered - or just when React has finished posting its updates to the DOM? If the former the test may incorrectly fail. </p>