rc-infinite-scroll-hook
v1.1.3
Published
react infinite scroll hook
Downloads
6
Readme
rc-infinite-scroll-hook
Infinite scroll react hook.
Demo
For example of the rc-infinite-scroll-hook, go to https://alllx.github.com/rc-infinite-scroll-hook.
OR
To run that demo on your own computer:
- Clone this repository
npm i
npm start
- Visit http://localhost:1234/
Getting Started
Install
npm i rc-infinite-scroll-hook -S
Import in component
import useInfiniteScroll from 'rc-infinite-scroll-hook'
Supported properties
containerRef: MutableRefObject<HTMLElement | null>;
fetchItems: () => Promise<any>;
triggerFetchPos?: number; // default: 300, height in pixels to the end of the scroll, to start fetching items earlier.