UNPKG

react-infinite-scroll-hook

Version:
20 lines (17 loc) 1 kB
import { IntersectionObserverHookArgs, IntersectionObserverHookRefCallback, IntersectionObserverHookRootRefCallback } from 'react-intersection-observer-hook'; export { IntersectionObserverHookRefCallback as UseInfiniteScrollHookRefCallback, IntersectionObserverHookRootRefCallback as UseInfiniteScrollHookRootRefCallback } from 'react-intersection-observer-hook'; type UseInfiniteScrollHookResult = [ IntersectionObserverHookRefCallback, { rootRef: IntersectionObserverHookRootRefCallback; } ]; type UseInfiniteScrollHookArgs = Pick<IntersectionObserverHookArgs, 'rootMargin'> & { loading: boolean; hasNextPage: boolean; onLoadMore: () => unknown; disabled?: boolean; delayInMs?: number; }; declare function useInfiniteScroll({ loading, hasNextPage, onLoadMore, rootMargin, disabled, delayInMs, }: UseInfiniteScrollHookArgs): UseInfiniteScrollHookResult; export { type UseInfiniteScrollHookArgs, type UseInfiniteScrollHookResult, useInfiniteScroll as default };