title: Listen to top url from React app inside iframe
body: <p>I have two react apps. The parent app loads the child app using an iframe.</p>
  <p>I can access the top URL using window.top.location (since both apps have the same origin).</p>
  <p>The problem is that. when the location changes, I need to update the state in my child app:</p>
  <pre><code>const topLocation = window.top.location;
  
  useEffect(() =&gt; {
   // Do something
  }, [topLocation]);
  </code></pre>
  <p>The problem is that the URL change doesn't trigger a re-render, so the topLocation value never changes.</p>
  <p>Any ideas?</p>