title: React Router and scrollTo behaviour
body: <p>I'm trying to get the following functionality with React Router when I click on a link.</p>
  
  <p>Let's say this is my current location: <code>page/1</code></p>
  
  <p>If I'm currently on page 1 (<code>page/1</code>) and I click on a link that takes me to <code>page/1</code>, <strong>I would like the browser to scroll to the top of the page</strong> using something like window.scrollTo with a smooth behaviour.</p>
  
  <p>If I'm on any other page, for example <code>page/2</code>, I would like the <strong>standard Redirect behaviour</strong>.</p>
  
  <p>What would be the best way to accomplish something like this? I thought about something like:</p>
  
  <p><code>if current location === page I'm trying to access -&gt; scroll behaviour</code></p>
  
  <p><code>else Redirect</code></p>
  
  <p>I'm wondering if there's a better way to do this? For example, always redirect and scroll to top, so even if I click on the same page it would scroll anyways</p>