Skip to content

onPress() not working in dynamic carousel child #38

@davidcort

Description

@davidcort

`<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>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions