Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resetScroll on routes changes #189

Closed
bermudezjorge opened this issue Apr 1, 2021 · 2 comments
Closed

resetScroll on routes changes #189

bermudezjorge opened this issue Apr 1, 2021 · 2 comments

Comments

@bermudezjorge
Copy link

I really like wouter is small and has everything I need, but I was facing a problem that the scroll doesn't reset on routes changes. Would be a nice idea we can set a prop to reset scroll on routes changes.

@vially
Copy link

vially commented Apr 1, 2021

This seems to be already possible using the solution suggested here: #132 (comment).

@molefrog
Copy link
Owner

molefrog commented Apr 2, 2021

I agree with @vially, the solution proposed in react-router docs should work just fine.
By the way, they also have an nice explanation of why this feature is no longer the part of the library and I think we should follow the same approach here.

https://reactrouter.com/web/guides/scroll-restoration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants