react-scroll
react-scroll copied to clipboard
scroller.scrollTo does not work
I'm not sure if I'm doing something wrong, but scroller.scrollTo suddenly stopped working and I can't seem to find the issue. There are no errors thrown.
import { Element, scroller } from 'react-scroll'
scroller.scrollTo('heroSection', {containerId: 'myContainer'})
The button that triggers the callback that scroller is in is inside myContainer
I resolved this by using:
scroller.scrollTo('heroSection', {container: 'myContainer'})
I appreciate this library but this was not noted anywhere in the documentation and just wasted 2 hours of my time trying to figure this out.
Thank you @gavinpatkinson, It works for me.