A component to make all your infinite scrolling!
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');
// payload: { skip: 0 }
const getData = (payload) => {
// api call
};
<ReactEasyInfiniteScroll
listLength={data.list.length}
totalRecords={data.totalRecords}
apiCallBack={getData}
/>;
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 |
Parth Patel |