meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.36k stars 2.29k forks source link

Carousel refresh when snapToPrev() or scroll back #693

Open kkusanagi opened 4 years ago

kkusanagi commented 4 years ago

Not sure it this an issue.

When i load 20 items, and use snapToPrev() or scroll back to last item. code as below

<Carousel
              ref={(c) => { this._foodcarousel = c; }}
              layout={'default'}
              sliderWidth={sliderWidth}
              itemWidth={itemWidth}
              data = {this.state.food_dataSource}
              renderItem={this._renderCarouselItem}
              loop={true}
              autoplay={true}
              autoplayInterval={5000}
            />

let say the item is sort like [19],[20],[1],[2],[3] [1]: main view

At here i use snapToPrev() or scroll back to [20], and suddenly whole carousel item is being refresh. Are we able to avoid this from refresh. I think it is not necessary to refresh.

"react": "16.9.0", "react-native": "^0.60.5", "react-native-snap-carousel": "^3.9.0",

rodriguezmanu commented 3 years ago

+1

dohooo commented 3 years ago

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2