react-loadmore-component

react loadmore component

Usage no npm install needed!

<script type="module">
  import reactLoadmoreComponent from 'https://cdn.skypack.dev/react-loadmore-component';
</script>

README

react-loadmore-component

A loadmore component for react.

NPM downloads

Demo GIF

Usage

$ npm install react-loadmore-component --save

import LoadMore from 'react-loadmore-component';

<LoadMore
  loading={loading}
  completed={completed}
  onLoadMore={this.handleLoadMore}
>
  <WrappedComponent />
</LoadMore>

Props

Property Description Type Default
loading required, display loading component bool false
completed required, display completed component and uninstall the listener bool false
onLoadMore required, callback function () => {} -
distance distance from the bottom of the page to trigger the callback function number 100
style loadmore container style Object -
indicator indicator config, custom loading and end display, { loading: ReactNode, completed: ReactNode }, if ReactNode is null, display default Object -

Thanks.