react-native-collapsible-tab-view icon indicating copy to clipboard operation
react-native-collapsible-tab-view copied to clipboard

Getting current scroll position with useCurrentTabScrollY using FlashList

Open kaitoo1 opened this issue 2 years ago • 1 comments

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>

kaitoo1 avatar Sep 28 '23 07:09 kaitoo1

useAnimatedReaction(
	() => scrollY.value,
	(y) => {
		runOnJS(scrollHandler)(y);
	},
	[]
);

chen8520 avatar May 21 '24 01:05 chen8520