react-snp-infinite-scrollerGithub | Documentation
Step 1: Install it
Install react-snp-infinite-scroller using npm
npm install --save react-snp-infinite-scroller
Step 2: Import it
Import it into your component
import {useElementScroll, useWindowScroll} from 'react-snp-infinite-scroller';
Step 3: Use it
Make window or an element call a function each time that it reaches to the end of the page
useElementScroll({reference, callback, hasMore, threshold}); useWindowScroll({callback, hasMore, threshold});