trevorr / react-scroll-manager

Scroll position manager for React applications
ISC License
36 stars 13 forks source link

Does not appear to work with React Router v5. #6

Open BBaysinger opened 4 years ago

BBaysinger commented 4 years ago

I tried several configurations. No errors, but basically functions as if there was no scroll restoration at all.

I had some luck reverting to v4, but still wasn't totally working. I can come back and fill in more details as time allows.

trevorr commented 4 years ago

I haven't had a chance yet to try it with RRv5. I'll try to get to it in a few weeks, as I plan to start a new React project then.

BBaysinger commented 4 years ago

Ok, thank you.

kelly-tock commented 4 years ago

any updates on this?

trevorr commented 4 years ago

Sorry, none yet. I have been using RRv5 in some new projects, but none have needed scroll restoration yet. If someone can point me to a repository that demonstrates the problem, I'm happy to take a look. However, I don't have time at the moment to try to reproduce the issue from scratch.

trevorr commented 3 years ago

I've been able to reproduce this in a RRv5 project. The WindowScroller is not updated because of the RRv5 change to use the new context API for passing location: https://reacttraining.com/blog/react-router-v5/. I think I'll need to make a new major version for RRv5. It will also be an opportunity to move to hooks and Typescript.

BenjaminVanRyseghem commented 3 years ago

I am using react-router 5.1.2, and it works like a charm!