react-scroll icon indicating copy to clipboard operation
react-scroll copied to clipboard

scroller.scrollTo does not work

Open g-a-v-i-n opened this issue 9 years ago • 2 comments

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

g-a-v-i-n avatar Aug 01 '17 19:08 g-a-v-i-n

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.

g-a-v-i-n avatar Aug 01 '17 20:08 g-a-v-i-n

Thank you @gavinpatkinson, It works for me.

Neungzad avatar Aug 02 '17 11:08 Neungzad