scroll position on navgiate
Author: gniquilCreated Feb 14, 2019Updated Jul 18, 2023
Labelsneeds docs
Hi all,
Whenever I click on Link, i don't see the page jump back to the top. After reading the code, I can't find anywhere mentioning window.scrollTo. So is this not the default behavior? If so, I did the following, is this right?
history.listen(({ action }) => {
if (action !== 'POP') {
window.scrollTo(0, 0);
}
});
...
<LocationProvider history={history}>
<Router>
...Source: reach/router