Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vdmrgv authored Jul 3, 2022
1 parent 13e0373 commit de57495
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ import useInfiniteScroll from 'react-easy-infinite-scroll-hook';

const InfiniteListComponent = ({ isLoading, items, canLoadMore, next }) => {
const { setRef } = useInfiniteScroll({
// function to fetch more items
next,
// the number of items loaded if you use the "Y-scroll" axis ("up" and "down")
// if you are using the "X-scroll" axis ("left" and "right") use "columnCount" instead
// you can also use "columnCount" and "rowCount" if you use "Y-scroll" and "X-scroll" at the same time
rowCount: items.length,
// should load more items in the specified direction
// support for all directions "up", "down", "left", "right", both individually and in all directions at the same time
hasMore: { down: canLoadMore },
});

Expand Down

0 comments on commit de57495

Please sign in to comment.