react-native-reanimated-carousel
react-native-reanimated-carousel copied to clipboard
Some kind of onScroll prop needed
I want to have possibility to control some another custom animations related to translate position of Carousel scroll.
For example in ScrollList/FlatList we have onScroll prop that pass NativeScrollEvent to callback. It's can be used with useAnimatedScrollHandler from reanimated v2.
const translateX = useSharedValue(0);
const scrollHandler = useAnimatedScrollHandler((event) => {
translateX.value = event.contentOffset.x;
});
<Animated.ScrollView onScroll={scrollHandler}>{...}</Animated.ScrollView>
As I see most closest variable in your Carousel is handlerOffsetX that also is Animated SharedValue. So, I'll try to play with it, but probably you can suggest another way to get position on scrolling.
try this

I'll reopen this issue If you have any other questions.