Super easy scroll pagination for React.
yarn add scrollify-list
import React, { Component } from 'react'
import ScrollifyList from 'scrollify-list'
export default class App extends Component {
getData() {
return Array(500).fill(null).map(() => ({id: Math.random().toString(36).substring(7), name: Math.random().toString(36).substring(7)}))
}
render() {
return <ScrollifyList data={this.getData()} render={(data, index) => <h1 key={data.id}>{data.name}</h1>}/>
}
}
Property | Explanation |
---|---|
data | Your data! Array of something. |
render | How do you want to render your data? |
pageSize | How many rows in one page? Defaults to 15. |
- Clone this repository (git clone git@github.com:anttikon/scrollify-list.git)
- Build it:
yarn build
- Add it to your project:
yarn add file:/path/to/scrollify-list
- ???
- Profit! 😎✌️