title: React - correct way to wait for page load?
body: <p>In React JS, what is the correct way to wait for a page to load before firing any code?</p>
  
  <p>Scenario:
  A login service authenticates a user then redirects them (with a cookie), to a React App.
  The React App then straight away searches for a cookie and validates it against an endpoint.</p>
  
  <p>But the problem I am getting is when user is authenticated at login service, then forwarded to React App, the App is loading so quick before cookie is even loaded.</p>
  
  <p>What is the right way to fire the code? I tried wrapping in a componentDidMount(), didnt work!</p>