intellidev1991 / react-native-image-slider-box

A simple and fully customizable React Native component that implements an Image Slider UI.
MIT License
284 stars 100 forks source link

pagination not reset when loading new images #141

Open nicoladj77 opened 2 years ago

nicoladj77 commented 2 years ago

I am using the image slider in an app similar to tinder. The slider holds images, and when you press like or dislike new data is loaded. The issue is that if I slide to the third image on the first page, when the second sets of images is loaded, the third image is shown, not the first. This is my setup

const ImageSlider = ({
  images,
  paginationBoxVerticalPadding,
  sliderBoxHeight,
}) => {
  return (
    <View>
      <SliderBox
        sliderBoxHeight={hp(sliderBoxHeight)}
        images={images}
        dotColor={'#FFF'}
        paginationBoxVerticalPadding={hp(paginationBoxVerticalPadding)}
        inactiveDotColor={'rgba(256, 256, 256, 0.5)'}
        ImageComponent={FastImage}
        firstItem={0}
        disableOnPress
      />
    </View>
  );
};