A android scrollView decorator for support bounce.
This library is forked from react-native-overscroll. Because this library has not been updated for a long time, update the library implementation and add event callbacks.
This library support old arch and new arch.
yarn add react-native-overscroll2
import { FlatList } from 'react-native';
import { OverscrollView } from 'react-native-overscroll2';
const data = Array.from({ length: 20 }, (_, i) => `Item ${i + 1}`);
<OverscrollView
bounce={true}
onOverscroll={(event) => {
console.log(
'onOverscroll',
event.nativeEvent.state,
event.nativeEvent.offset
);
}}
>
<FlatList
data={data}
keyExtractor={(_item, index) => index.toString()}
renderItem={renderItem}
overScrollMode="always"
/>
</OverscrollView>;
MIT