3

apparently LocomotiveScroll isn't imported, so I can't use smooth scroll: '''import LocomotiveScroll from 'locomotive-scroll';'''

2 Answers2

2

I ran into the same issue while using typescript. I was able to resolve it by installing the locomotive type definitions after I installed locomotive itself.

npm install locomotive-scroll
npm i --save-dev @types/locomotive-scroll
0

first you need to install locomotive scroll

try

npm install locomotive-scroll

and then on you js file

import LocomotiveScroll from "locomotive-scroll";

   let options = {
        el: currentScrollContainer,
        smooth: true,
        getSpeed: true,
        getDirection: true,
    };
    scroll = new LocomotiveScroll(options);
Dpk
  • 567
  • 5
  • 16