Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

63
Views
How to use scrollTo in locomotive-scroll with reactJS

How to configure the LocomotiveScrollProvider so that when the button is pressed, it scrolls to the top of page?

<LocomotiveScrollProvider
  options={
    {
      smooth: true,
   
    }
  }
  watch={
    []
  }
  onLocationChange={scroll => scroll.scrollTo(0, { duration: 0, disableLerp: true })}
  onUpdate={() => console.log('Updated, but not on location change!')} 
>

<button onClick = {}> Click </button>

</LocomotiveScrollProvider>
7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs