Fires loadMore
prop when end of content becomes visible.
import {InfiniteScroll} from 'libreact/lib/InfiniteScroll';
<InfiniteScroll
hasMore={true || false}
cursor={cursor}
loadMore={() => {/* ... */}}
>
{items}
</InfiniteScroll>
loadMore
— required, function that is called when user scrolls to the bottom of the component.cursor
— required, unique identifier of current page,loadMore
is called only once for each adjacent unique value ofcursor
.hasMore
— optional, boolean, whether there are more items to load, if set tofalse
,loadMore
will not be called.sentinel
— optional, React element to render at the bottom of the component, when this element becomes visible it triggersloadMore
function, defaults to empty<div>
pixel.margin
— optional, number, invisible margin beforesentinel
when to already callloadMore
beforesentinel
is visible, defaults to100
.