-1

I was trying to find any tutorial about the implementation of react-native-snap-carousel example but I couldnt find any. If any of you have seen any tutorials on this, please suggest a link. I have been through its documentation and examples provided by the creators of it, however they look very complicated to me.

showtime
  • 1
  • 1
  • 17
  • 48

1 Answers1

1

you have to provide data and it will do automatically mapping and assign functional component to render item it will return json format with index and item you can see below example

const container = ({edges,_loadmore,navigation}) =>{
 const _renderItem = ({ item, index }) => {
 return (
    <View>
      <Render_component  />
    </View>
   );
};
    return (
     <Carousel
    onSnapToItem={slideIndex => {
      setcurrentSlider(slideIndex);
      _loadMore();
    }}
    onBeforeSnapToItem={slideIndex => {
      setBeforeSlider(slideIndex);
    }}
    inactiveSlideOpacity={1}
    inactiveSlideScale={1}
    enableSnap
    ref={carRef}
    data={edges}
    renderItem={_renderItem}
    sliderHeight={screenHeight}
    itemHeight={screenHeight}
    vertical={true}

    />
    )
}
Mayank Pandav
  • 425
  • 5
  • 20