MindeesUI
ComponentsMobile

InfiniteScroll

A generic FlatList that calls onLoadMore as the list nears its end, showing a footer spinner while loading and guarding against duplicate end events.

InfiniteScroll is a typed FlatList for paginated data. It calls onLoadMore when the list nears its end, shows a footer Spinner while loading is true, and guards against the burst of end-reached events FlatList fires during a fast scroll so a page is requested only once per content layout.

Import

import { InfiniteScroll } from '@mindees/ui';

Usage

<InfiniteScroll
  data={items}
  renderItem={({ item }) => <Row item={item} />}
  onLoadMore={fetchNextPage}
  loading={isFetchingNextPage}
/>

Props

PropTypeDefaultDescription
dataItemT[]The list items.
renderItemListRenderItem<ItemT>Renders each row.
onLoadMore() => voidCalled when the list nears its end and is not already loading.
loadingbooleanfalseWhether a page is being fetched; controls the footer spinner.
onEndReachedThresholdnumber0.5Distance from the end (0-1) that triggers onLoadMore.
styleStyleProp<ViewStyle>Style applied to the FlatList.

All other FlatList props are accepted, except those the component manages (data, renderItem, onEndReached, and ListFooterComponent).

Accessibility

The list uses accessibilityRole="list", and each row inherits the accessibility of whatever renderItem returns. The footer spinner appears only while loading and is purely visual; loading state is best conveyed through the items themselves for assistive tech.

On this page