I have a sign up form with a sign up button at the bottom of that page that navigates a user to a different page upon submittion. The scroll position persists when navigate() happens, where as I was hoping it would reset at the top of the page like <Link/> does.
I think that this is not an issue with the router, it has to do with the way SPAs work, maybe you can use something like window.scrollTo(x, y).
I experience the same problem with Links. The page jumps to the container associated with the route. This really should not be the default behavior. I was using react router before and the page would stay still in the same setup.
Example: https://codesandbox.io/s/y0jmjj2o8j
Same issue.
It only happens if you are using nested <Router>, the page gets scrolled to the <Router> element on the page (or it's children like simoroshka supposed)
For all who are the same stupid as I am - there is a documented prop for router called primary that controls this behavior
The issue may be closed
We would never consider you or others "stupid" but your research and help in pointing out the primary prop is much appreciated 馃弲
Most helpful comment
We would never consider you or others "stupid" but your research and help in pointing out the
primaryprop is much appreciated 馃弲