I have y positions of elements such as burgers, loaded fries, etc. I need to fire a function when the bottom tip of scrollview scroll indicator reaches a specific y position(i have the y positions from onLayout of elements)? I'm aware of onScroll nativeEvent but don't know how to do the math?
<Animated.ScrollView
showsVerticalScrollIndicator
scrollEventThrottle={16}
onScroll={({nativeEvent}) => {
scrollY.value = nativeEvent.contentOffset.y;
}}
Ideally as you see on the screen shot, you see scroll indicator on the right edge, so when y position of it matches the title, e.g. Burgers, I want to fire a function, and if it reaches the title Loaded fries below, fire a function, still not have idea how to calculate it?