react-scroll-provider
v0.1.0
Published
React component that allows scroll height detection.
Downloads
3
Readme
React Scroll Provider
React component that allows scroll height detection.
Install and usage
npm install react-scroll-provider
Example usage
import {Provider} from 'react-scroll-provider'
...
scrollHandler(height){
}
render(){
return (
<Provider onScroll={this.scrollHandler.bind(this)}>
<div>
...
</div>
</Provider>
)
}
...
- More to come, feel free to contribute on Github
Props
- onScroll - function - a function executed when scrolling happens. Function provides a value from 0 to 1 (top to bottom) of scroll height.
- component - OBJECT - dom object to attach the scroll provider to. (TODO)