useInfiniteScroll

useInfiniteScroll hook provides a convenient way to implement infinite scrolling in a React component.

Example

Params
paramDescriptionTypeDefault
offsetThe offset from the bottom of the container at which to trigger the load more action.string'0px'
shouldStopFlag to stop the infinite scroll from triggering further load more actions.booleanfalse
onLoadMoreThe function to be called when the user reaches the bottom of the container.() => Promiseundefined
Return
returnDescriptionTypeDefault
isLoadingIndicates whether the hook is currently loading more content.boolean
containerRefA ref callback function to be assigned to the container that requires infinite scrolling.LegacyRef