React Simple Infinite Scroll
A brutally simple infinite scroll helper component.
Install
npm install react-simple-infinite-scroll --save
Usage
Component state = items: isLoading: true cursor: 0 { // do some paginated fetch this } { this } { return <div> <InfiniteScroll throttle=100 threshold=300 isLoading=thisstateisLoading hasMore=!!thisstatecursor onLoadMore=thisloadMore > thisstateitemslength > 0 ? thisstateitems : null </InfiniteScroll> thisstateisLoading && <MyLoadingState /> </div> }
Author
- Jared Palmer @jaredpalmer