PedroBern / react-native-collapsible-tab-view

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

onScroll on flatlist does not work #357

Open nica0012 opened 10 months ago

nica0012 commented 10 months ago

Love this package. The only issue I have come across is onScroll does not seem to work on the tabs.flatlist.

I am trying to detect scroll distance to a animate a nav bar title. I cant use the hooks because I am coding inside of a class component...

Is anyone else facing this issue?

Adil21 commented 10 months ago

you can use the useCurrentTabScrollY hook to detect scroll distance.

nica0012 commented 10 months ago

@Adil21 Hi, I completely converted my class component to a functional component to use this hook, but it still does not seem to work.

I tried importing useCurrentTabScrollY from the library which didn't work so I looked at the example and copied that code into my own hooks folder but that did not work either...

I get the following error, I've seem others with it too:

usetabcontext must be used inside a tabs.container

kurniawanj26 commented 6 months ago

@Adil21 Hi, I completely converted my class component to a functional component to use this hook, but it still does not seem to work.

I tried importing useCurrentTabScrollY from the library which didn't work so I looked at the example and copied that code into my own hooks folder but that did not work either...

I get the following error, I've seem others with it too:

usetabcontext must be used inside a tabs.container

did you find any solution for this?