0.0.11 • Published 8 years ago

react-keep-scrolling v0.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

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.

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

1.0.0

8 years ago