Open niloufarMakhzani opened 4 years ago
Did anyone find a workaround for this issue?
After reading the following: https://github.com/archriss/react-native-snap-carousel/blob/master/doc/KNOWN_ISSUES.md#rtl-support-experimental
I found a workaround by reversing order of data array calling .reverse() from data array that was passed to data prop of Carousel:
<Carousel ref={(c) => { this._carousel = c}} data={I18nManager.isRTL? cities.reverse() : cities} renderItem={this.renderCarouselCity} sliderWidth={Dimensions.get("window").width * 0.9} itemWidth={Dimensions.get("window").width * 0.7} onSnapToItem={this.onSnapCarousel} />
Use useScrollView
and firstItem
like this:
<Carousel
data={this.state.data}
useScrollView={I18nManager.isRTL? true: false}
firstItem={I18nManager.isRTL? this.state.data.length-1: 0}
/>
Before attaching list make list mutation reverse. // i found difficulties while reversion with array.reverse()
const imgList = I18nManager.isRTL ? imageList.slice().reverse() : imageList; return ( <Carousel layout={"default"} data={imgList} ...
This works for me
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
Is this a bug report, a feature request, or a question?
Question
Thanks for your great library and documentation. I'm using your library but I want to have the autoPlay to slide from right to left. Is there any props to handle this or is it possible for you to make it happen. I managed to do it by editing snapToNext method, but I prefer to use your library using npm so I need it to be added as a prop.
Thanks in advance