0

I am using react-scroll in react and i am trying to scroll the container div overflow-y after doing an action click in a button, but the function scrolls the body overflow not the container div. How can i do it?

The body has overflow: hidden, and the container div has overflow-y: scroll

1 Answer 1

0

Please check this link : https://medium.com/how-to-react/scroll-to-an-element-on-click-in-react-js-8424e478bb9

if you face any problem following the doc then open the code sandbox and play with the code and see the demo.

1
  • My problem is not with how the library works, i understand it. My problem is scroll in a div and not in a body
    – PORMAZION
    May 8, 2021 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.