I'm using react-router-dom, and routed components, so I think it's the leading cause. I want to make a scroll to the top button. I tried using window.scrollTop(0,0) but still not working (the button does nothing, no error caused).
Thanks for your help. Glad to get a response from you.
I think the scrollTo button didn't work for me. You can check why it doesn't work on my site: Example
This is how I wrote the component, same as the documentation code you have given:
I'm using
react-router-dom
, androuted components
, so I think it's the leading cause. I want to make a scroll to the top button. I tried usingwindow.scrollTop(0,0)
but still not working (the button does nothing, no error caused).Thanks for your help. Glad to get a response from you.