zachgibson / react-native-parallax-swiper

Paged Parallax Swiper with Effects
MIT License
623 stars 76 forks source link

getting error when setState in onMomentumScrollEnd #49

Open arunabhverma opened 3 years ago

arunabhverma commented 3 years ago

<ParallaxSwiper speed={0.5} animatedValue={myCustomAnimatedValue} dividerWidth={8} dividerColor="black" backgroundColor="black" vertical onMomentumScrollEnd={activePageIndex => setState((prev) => ({ ...prev, index: activePageIndex }))} showProgressBar={true} progressBarBackgroundColor="rgba(0,0,0,0.25)" progressBarValueBackgroundColor="white"

error is : 

image

arunabhverma commented 3 years ago

without onMomentumScrollEnd or with onMomentumScrollEnd={activePageIndex => console.log(activePageIndex)} it working fine.

arunabhverma commented 3 years ago

but I want to setState index of page when scroll end