/react-snp-infinite-scroller

This package will let you to call a function on scrolling window or an element

Primary LanguageJavaScript

react-snp-infinite-scroller

Github | 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});