https://github.com/Artrogeno/react-scrollspy-animate
npm install react-scrollspy-animatehttps://github.com/Artrogeno/react-scrollspy-animate
> Scrollspy Animate Component
> Demo
``sh`
$ yarn add react-scrollspy-animate
`js
import Scrollspy from 'react-scrollspy-animate'
...
`
`js`
Scrollspy.propTypes = {
tag: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
componentClass: PropTypes.string,
scrolledPastClassName: PropTypes.string,
active: PropTypes.string,
level: PropTypes.number,
offset: PropTypes.number,
timeout: PropTypes.number,
rootEl: PropTypes.string,
animete: PropTypes.object,
onUpdate: PropTypes.func
}
`html
Section 1
Section 2
Section 3
$3
`html
Section 1
Section 2
Section 3
`$3
`
Section 1
Section 2
Section 3
`$3
`
Section 1
Section 2
Section 3
`
$3
`
// --> Animete
//
{
behavior: "auto" | "instant" | "smooth",
block: "start" | "end",
}// --> Set hash your browser in 500 milliseconds
//
setTimeout(() => {
window.location.hash = '#section-2'
}, timeout);
``