Socket
Socket
Sign inDemoInstall

react-keep-scrolling

Package Overview
Dependencies
22
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-keep-scrolling

react-keep-scrolling React component


Version published
Maintainers
1
Created

Readme

Source

react-keep-scrolling

Instalation

  • npm install react-keep-scrolling --save
  • yarn add react-keep-scrolling

Usage

properties

  • before
  • getMore
  • initialLoad
before

cals your getMore function before hitting the bottom of the bage by that value default is 200

getMore

the function that will be called when the scroll happens

initialLoad

load the data when initializing

import React, {Component} from 'react'
import {render} from 'react-dom'

import ReactKeepScrolling from 'react-keep-scrolling'
class Demo extends Component {
  constructor(props){
    super(props)
    this.state ={
      numbers : '1234567890-3456789oqweqe908qwe'.split('')
    }
  }
  getMore(){
    this.setState({
        numbers: [...this.state.numbers, Math.random() * 1000]
      })
  }
  render() {
    const numbersLi = this.state.numbers.map((item, idx) => (<li key={idx}>{item}</li>))
    const getMore = this.getMore.bind(this)
    return <div>
      <span>we</span>
      <ul>
      <ReactKeepScrolling before={100} getMore={getMore}>
        {numbersLi}
      </ReactKeepScrolling>

      </ul>
    </div>
  }
}

render(<Demo/>, document.querySelector('#demo'))

Describe react-keep-scrolling here.

Keywords

FAQs

Last updated on 25 May 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc