use-firestore-pagination
A react hook for cumulative pagination of a firebase collection. This means that the query maintains a reference to existing documents when loading more documents.
Install
yarn add use-firestore-pagination
Basic usage
import usePagination from "use-firestore-pagination";import firebase from "firebase/app"; { const loading loadingError loadingMore loadingMoreError hasMore items loadMore } = ; return <div> loading && <div>Loading...</div> items hasMore && !loadingMore && <button =>Load more</button> </div> ;}