Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 2.5 KB

README.md

File metadata and controls

68 lines (49 loc) · 2.5 KB

react-easy-infinite-scroll
npm npm License: MIT

All Contributors

A component to make all your infinite scrolling!

Install

  npm install --save react-easy-infinite-scroll

  or

  yarn add react-easy-infinite-scroll

  // in code ES6
  import ReactEasyInfiniteScroll from 'react-easy-infinite-scroll';

  // or commonjs
  var ReactEasyInfiniteScroll = require('react-easy-infinite-scroll');

Using

// payload: { skip: 0 }
const getData = (payload) => {
  // api call
};

<ReactEasyInfiniteScroll
  listLength={data.list.length}
  totalRecords={data.totalRecords}
  apiCallBack={getData}
/>;

props

name type description
listLength number pass length of current data list.
totalRecords number pass total records to show
apiCallBack function api call back function, you will get skip value as object
loader (optinal) node you can change the loader by this property, by default we have set the loader
loaderColor (optinal) string default loader color can be change by this property

Contributors ✨


Parth Patel

LICENSE

MIT