Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting current scroll position with useCurrentTabScrollY using FlashList #372

Open
kaitoo1 opened this issue Sep 28, 2023 · 1 comment
Open
Labels
question Further information is requested

Comments

@kaitoo1
Copy link

kaitoo1 commented Sep 28, 2023

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>
@chen8520
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants