react-use-load-more

4.0.0 • Public • Published

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

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}</>;
};
 

/react-use-load-more/

    Package Sidebar

    Install

    npm i react-use-load-more

    Weekly Downloads

    0

    Version

    4.0.0

    License

    ISC

    Unpacked Size

    2.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • vivekneel