react-native-collapsible-tab-view
react-native-collapsible-tab-view copied to clipboard
Getting current scroll position with useCurrentTabScrollY using FlashList
I'm trying to trigger an effect when the scroll position of the tab changes by using the useCurrentTabScrollY hook.
unfortunately the hook only returns the initial scroll position, 0, when first rendered but doesn't seem to update when I scroll the FlashList on the tab.
not sure if it's an issue with how I'm using useCurrentTabScrollY, or if it's because im scrolling within a FlashList. has anyone experienced this?
the structure of the tab and list I have is essentially:
<Tabs.Container>
<Tabs.Tab>
<Tabs.FlashList/>
</Tabs.Tab>
</Tabs.Container>
useAnimatedReaction(
() => scrollY.value,
(y) => {
runOnJS(scrollHandler)(y);
},
[]
);