title: Why useEffect doesn't run on window.location.pathname changes?
body: <p>Why <strong>useEffect</strong> doesn't run on <code>window.location.pathname</code> changes? I get <code>loc</code> logged only once.</p>
  
  <p>How can I make to run <strong>useEffect</strong> when pathname changes without any additional libraries? </p>
  
  <pre><code>  useEffect(() =&gt; {
      const loc = window.location.pathname
      console.log({ loc })
    }, [window.location.pathname])
  </code></pre>