Why useEffect doesn't run on window.location.pathname changes? I get loc logged only once.
How can I make to run useEffect when pathname changes without any additional libraries?
useEffect(() => {
const loc = window.location.pathname
console.log({ loc })
}, [window.location.pathname])