Infinite Scroll
An infinite scroll container that loads more content using the IntersectionObserver API.
Installation
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
*isLoading | boolean | - | If |
*hasMore | boolean | - | If |
*next | () => unknown | - |
|
threshold | number | 1 | The threshold is the number of pixels from the bottom of the element where the next function will be called. The range of threshold is Since InfiniteScroll is implemented with IntersectionObserver, you can find more on MDN. |
root | number | null | This property will be used as the viewport for checking visibility of the last or the first item. Must be the ancestor of the item. Defaults to the browser viewport. Since InfiniteScroll is implemented with IntersectionObserver, you can find more on MDN. |
rootMargin | string | 0px | The rootMargin is the margin around the root. You can use any valid CSS unit like px, em, rem, %, etc. Since InfiniteScroll is implemented with IntersectionObserver, you can find more on MDN. |
reverse | boolean | false | Set this property to true means that InfiniteScroll will call If your |
children | ReactNode | undefined | This property is that user will see according to thethreshold position and call next on the viewpoint. |