title: Is there a way to tell when your react app page is done loading the page / assets?
body: <p>I have a script in my react app that I would like to run after the page is completely done loading. </p>
  
  <p>I've tried listening for the window load like this in componentDidMount / componentDidUpdate: </p>
  
  <pre><code>document.onreadystatechange = function () {
    if (document.readyState === 'complete') {
      // do stuff
    }
  }
  </code></pre>
  
  <p>This works once when the app is first loaded, but not on subsequent loads.</p>
  
  <p>I've also tried this: </p>
  
  <pre><code>window.onload = function () { alert("It's loaded!") }
  </code></pre>
  
  <p>But also the same result. </p>
  
  <p>I've tried adding this alert in a before hook on the history: </p>
  
  <pre><code>browserHistory.listen((location) =&gt; { 
    window.onload = function () { alert("It's loaded!") }
  }
  </code></pre>
  
  <p>This only works after I'm navigating though. 
  Is there an after hook for browserHistory that will run after the page is loaded?</p>
  
  <p><strong>Bottomline, I'd like to know when the page is loaded in a react app on route change and on refresh so I can execute a script.</strong></p>
  
  <p>Thanks</p>