scroll react code example
Example 1: how to scroll to an element javascript react
import { scroller } from "react-scroll";
// excluded React component syntax...
scrollToSection = () => {
scroller.scrollTo("your_css_class_here", {
duration: 800,
delay: 0,
smooth: "easeInOutQuart",
});
};
Example 2: react-scroll
$ npm install react-scroll
# or yarn
$ yarn add react-scroll