react-native-carousel-control
react-native-carousel-control copied to clipboard
onPress() not working in dynamic carousel child
`<Carousel pageStyle={{ overflow: Platform.OS == 'android' ? 'hidden' : 'visible', height: 285, elevation: 8, shadowColor: '#666666', shadowRadius: 9, shadowOpacity: 0.2, shadowOffset: { width: 0, height: 3 }, borderBottomLeftRadius: 20, borderBottomRightRadius: 20 }} pageWidth={width - 80} swipeThreshold={0.1}> { dataMagazine.map((item, i) => ( <View key={i} style={{flex: 1, height: 'auto'}} onPress={()=> alert('clicked !!') }>
<Image
style={{
flex: 1,
resizeMode: 'stretch',
backgroundColor: '#FFFFFF'
}}
source={{uri: `${uri}${item.imagen_principal}`}}
onPress={() => this.goToNote(item)}
/>
<MagazineTextContainer>
<LabelCategory>
{item.desc_categoria.toUpperCase()}
</LabelCategory>
<MagazineText>{item.titulo}</MagazineText>
</MagazineTextContainer>
</View>
))
}
</Carousel>`
Im guessing you've moved on but onPress doesn't work with views.
@rollsroyc3 you are right. This needed a TouchableOpacity or HighlitOpacity