PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
831 stars 161 forks source link

Infinite Scroll - allow passing through or combining onScroll events #143

Open alexpchin opened 3 years ago

alexpchin commented 3 years ago

Feature request

An infinite scroll example.

Current behavior

I have a Tab.FlatList with an infinite load. I was using an onMomentumScrollBegin with FlatList to throttle a call to onEndReached. However, now onMomentumScrollBegin doesn't fire as we're using react-native-reanimated.

If I create a scrollHandler with:

const scrollHandler = useAnimatedScrollHandler({
  onBeginDrag: (e) => {
    console.log('onBeginDrag');
  },
  onEndDrag: (e) => {
    console.log('onEndDrag');
  },
  onMomentumScrollBegin: (e) => {
    console.log('onMomentumScrollBegin');
  },
  onMomentumScrollEnd: (e) => {
    console.log('onMomentumScrollEnd');
  },
});

And pass to:

<Tabs.FlatList
  onScroll={scrollHandler}
  .
  .

I don't believe this will not be called as onScroll is created in the library.

anhquan291 commented 2 years ago

I'm facing the same issue. The onMomentumScrollBegin doesn't fire. Any solutions? Thank you

sahil-ahuja-1 commented 2 years ago

Any update here @PedroBern ?

IB3N commented 1 year ago

Also have this issue - React-Native-Tab-With-Infinite-Scroll seems to have a fix?