$ npm install react-scroll
# or yarn
$ yarn add react-scroll
ex)
import {Link} from 'react-scroll'
<Link to="about" spy={true} smooth={true}>About</Link>
.... .... .... ....
<div id="about" style={{height: 500}}>
<h1>This is About section</h1>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Id, repellendus. Totam nihil similique a repellat minus dolor amet quasi. Corporis nulla quaerat iste, sed quasi ab dolorem maxime minima animi.
</div>
$ npm install react-scroll
# or yarn
$ yarn add react-scroll
//Smooth Scroll in React js
function smoothScroll()
{
document.querySelector('.your_class or #id here').scrollIntoView(
{
behavior: 'smooth'
});
};