title: Scroll restore to top on navigation change
body: <p>I am having a problem with scrolling, when navigating using react-router.</p>
  
  <p>When I am navigating to a different component it is keeping the scroll position from the last navigation. However I want it to restore and start from the top whenever the navigation is changed.</p>
  
  <pre><code> class App extends Component{
    render() {
     return(
      &lt;BrowserRouter onUpdate={() =&gt; window.scrollTo(0, 0)} history={createBrowserHistory()}&gt;
        &lt;div style={{display: 'flex'}}&gt;
          &lt;div className='navBar'&gt;
            &lt;ul style={{listStyleType: 'none'}}&gt;
              &lt;li&gt;&lt;Link to='/'&gt;Home&lt;/Link&gt;&lt;/li&gt;
              &lt;li&gt;&lt;Link to='/towns'&gt;Towns&lt;/Link&gt;&lt;/li&gt;
              &lt;li&gt;&lt;Link to='/pubs'&gt;Pubs&lt;/Link&gt;&lt;/li&gt;
              &lt;li&gt;&lt;Link to='/venues'&gt;Venues&lt;/Link&gt;&lt;/li&gt;
              &lt;li&gt;&lt;Link to='/cinemas'&gt;Cinemas&lt;/Link&gt;&lt;/li&gt;
  
            &lt;/ul&gt;
          &lt;/div&gt;
  
          &lt;div style={{flex:1, padding:'0px'}}&gt;
            {routes.map((route) =&gt; (
              &lt;Route
                key={route.path}
                path={route.path}
                exact={route.exact}
                component={route.main}
                /&gt;
              ))}
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/BrowserRouter&gt;
       )
     }
   }
  </code></pre>
  
  <p>However it doesn't work. I have a feeling the issue is with my style of navigation rather then the window.scrollTo() snippet.</p>