How to use the react-scroll/modules.scroller.scrollTo function in react-scroll

To help you get started, we’ve selected a few react-scroll examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ultimate-ttt / ultimate-ttt / src / views / Analysis / Game / AnalysisGameDisplay.tsx View on Github external
function scrollToElement(moveNumberToScrollTo: number) {
  scroller.scrollTo(moveScrollElementBaseName + moveNumberToScrollTo, {
    duration: 300,
    smooth: true,
    containerId: 'moveList',
    // Thanks to this, when scrolling to an element, some elements above it will also be displayed
    offset: -250,
  });
}