Socket
Socket
Sign inDemoInstall

react-scroll-detector

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-detector

react-scroll-detector React component


Version published
Weekly downloads
27
increased by35%
Maintainers
1
Weekly downloads
 
Created
Source

react-scroll-detector

Travis npm package Coveralls

Demo

Live demo

Local demo:

git clone https://github.com/rechat/react-scroll-detector.git
cd react-scroll-detector
npm i && npm start

Installation

npm i react-scroll-detector --save

Example

import React from 'react'
import ReactScrollDetector from 'react-scroll-detector'

class App extends React.Component {
  handleScrollBottom() {
    console.log('On Scroll Bottom')
  }

  handleScrollTop() {
    console.log('On Scroll Top')
  }

  render() {
    return (
      <ReactScrollDetector
        debounceTime={500}
        accuracy={90}
        onScrollBottom={this.handleScrollBottom}
        onScrollTop={this.handleScrollTop}
      >
        <div style={{ minHeight: '500px', maxHeight: '500px', overflow: 'auto' }}>
          ...
        </div>
      </ReactScrollDetector>
    )
  }
}

API

PropTypeDescriptionDefault
onScrollBottomFunctionTriggers when scroll reaches bottom(top) => {}
onScrollTopFunctionTriggers when scroll reaches top(top) => {}
accuracyNumberAccuracy of detection90
debounceTimeNumberD etection debounce time in milli seconds500

License

MIT

Keywords

FAQs

Package last updated on 13 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc