title: How to distinguish if useEffect is triggered by route change
body: <p>As I know useEffect can be triggered by the following conditions</p>
  <ol>
  <li>dependencies change</li>
  <li>Route change</li>
  <li>Initial render</li>
  </ol>
  <p>I have the following component, <code>data</code> is a complex object. When it is triggered by route change, the <code>data</code> prop has the cached value. Everything else such as state, ref get reset.</p>
  <pre><code>const App = memo(({ data }}) =&gt; {
    useEffect(() =&gt; {
       // if triggered by route change, do thing
       
    }, [data]);
  
    return (&lt;div /&gt;)
  });
  </code></pre>
  <p>What is the best way to distinguish if useEffect invoked by route change?</p>