Bug report
Yes.
Yes.
Yes.
I've only tested it on iOS.
I'm unsure.
Yes.
Environment:
React: 16.2.0
React native: 0.52.0
react-native-snap-carousel: 3.6.0
Target Platform:
iOS (11.2)
(Write your steps here:)
<Pagination
containerStyle={{
flexDirection : 'row',
height : 50,
paddingTop : 0,
paddingBottom : 0
}}
renderDots={ activeIndex => (
IONICON_NAMES.map((ioniconName, i) => (
<View
style={{ flex : 1, alignItems : 'center' }}
key={ i }
>
<Ionicons
name={ ioniconName }
color={ i === activeIndex ? '#4a90e2' : '#000' }
size={ 30 }
/>
</View>
))
)}
activeDotIndex={ this.state.activeTab }
dotsLength={ 3 }
tappableDots={ !!this.carouselRef }
carouselRef={ this.carouselRef }
/>
Before implementing a custom renderDot component, tapping on a given dot would trigger the correct snapToItem method call. With the custom renderer, tapping on a given tab (custom dot) does not result in the same behavior.
There is no error message. From renderDot's 3 available parameters (activeIndex, total, context), none contains the snapToItem method. If they did, I'd be able to pass this method to the dot components. I originally thought that react-native-snap-carousel would, behind the scenes, wrap the custom dot components with onPress callbacks. But it appears that using dotRenderer overrides the tappableDots behavior altogether.

Just updated the original post with the Snack demo :) THANK YOU!
Hey @harrysolovay,
I haven't made it clear in the doc, but when you use the renderDots prop, dots' onPress logic is lost and you need to provide yours. I admit that this can be pretty confusing and I'll fix this in the next release.
For now, I've updated your Snack example and brought in the logic of the PaginationDot component ;-)
You can find it here: https://snack.expo.io/SkG6Agluz
Worked like a charm. Thank you @bd-arc !!!
@harrysolovay You've edited your message, so your question doesn't appear anymore, but here is my answer anyway ;-)
You should definitely use another plugin to create tabs; in fact, I recommend react-native-tab-view which I've used in production with great success.
For more info about why I'd rather go with other plugins for fullscreen carousels, see this. And if you decide on using the tab plugin, take a look at #258 ;-)
I actually emailed that to you directly (but kept the issue string as the subject––never posted it here)... sorry if that was confusing. Thank you for recommending me react-native-tab-view. You've been so so so helpful!!!
@harrysolovay Happy to help! And, indeed, you're right: I got confused :-)
Most helpful comment
Hey @harrysolovay,
I haven't made it clear in the doc, but when you use the
renderDotsprop, dots'onPresslogic is lost and you need to provide yours. I admit that this can be pretty confusing and I'll fix this in the next release.For now, I've updated your Snack example and brought in the logic of the
PaginationDotcomponent ;-)You can find it here: https://snack.expo.io/SkG6Agluz