0.1.0 • Published 5 years ago

react-scroll-provider v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Scroll Provider

React component that allows scroll height detection.

Install and usage

  1. npm install react-scroll-provider

  2. Example usage

import {Provider} from 'react-scroll-provider'

...
    scrollHandler(height){

    }

    render(){
        return (
            <Provider onScroll={this.scrollHandler.bind(this)}>
                <div>
                    
                    ...

                </div>
            </Provider> 
        )
    }

...
  1. 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)