Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021import { type NativeScrollEvent, type NativeSyntheticEvent,} from 'react-native'
export const isCloseToBottom = ( {contentOffset, layoutMeasurement, contentSize}: NativeScrollEvent, threshold = 120,): boolean => contentOffset.y + layoutMeasurement.height >= contentSize.height - threshold
// scroll props for a ScrollView that pages a non-virtualized list:// fires onEndReached as the bottom nears. spread onto Layout.ModalContentexport const infiniteScroll = (onEndReached: () => void) => ({ scrollEventThrottle: 16, onScroll: (e: NativeSyntheticEvent<NativeScrollEvent>) => { if (isCloseToBottom(e.nativeEvent)) onEndReached() },})