react-simple-scrolldown
v1.0.2
Published
ReactJS ES6 simple scroll down animation with minimal usage
Downloads
4
Readme
react-simple-scrolldown
ReactJS ES6 simple scroll down animation with minimal usage.
Installation
npm i react-simple-scrolldown
Usage
Make sure the target element has as className the same id of the source element. scrollDown accepts two parameters, event and callback.
import React from 'react';
import ReactScroll from 'react-simple-scrolldown';
class Foo {
constructor() {
super();
this.reactScroll = new ReactScroll();
}
render() {
return(
<React.Fragment>
<a href="#" id="target" onClick={this.reactScroll.scrollDown}>Link text</a>
.
.
.
.
<div className="target">content</div>
</React.Fragment>
);
}
}