4.0.0 • Published 4 years ago

react-use-load-more v4.0.0

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

use-infinite-scroll

A custom react hook for listening the end of the scroll to support load more feature.

Requirement

To use this hook, you must be on react@16.8.0 or greater than that.

Demo

npm.io

Installation

Using npm :

npm install react-use-load-more

Using yarn :

yarn add react-use-load-more

Usage :

const App = () => {
  const handleLoadMore = () => {
    // fetch more data
  };
  const hasMoreItems = true;
  const [isLoading] = useInfiniteScroll(handleLoadMore, hasMoreItems);
  return <>{isLoading ? "your loading component" : null}</>;
};