UNPKG

react-native-ui-lib

Version:

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://stand-with-ukraine.pp.ua)

29 lines (28 loc) 975 B
import { NativeSyntheticEvent, NativeScrollEvent } from 'react-native'; export type ScrollEnablerProps = { /** * Whether the scroll is horizontal (default is false). */ horizontal?: boolean; /** * Allows to be notified prior to actually reaching the start \ end of the scroll (by the threshold). * Should be a positive value. */ threshold?: number; }; export type ScrollEnablerResultProps = { /** * onScroll callback (should be set to your onScroll). */ onScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void; /** * Is the scroll at the start (or equal\smaller than the threshold if one was given) */ isScrollAtStart?: boolean; /** * Is the scroll at the end (or equal\greater than the threshold if one was given) */ isScrollAtEnd?: boolean; }; declare const useScrollReached: (props?: ScrollEnablerProps) => ScrollEnablerResultProps; export default useScrollReached;