Skip to content

onPressItem not working in New Arch #232

@ademir10

Description

@ademir10

After to update our project to the new arch onPressItem stoped to work, do you know what can we do to fix it?

relevant code:

async function sendWhatsAppMessage(tipo_suporte) {
.
.
.
}

            <LinearGradient>

                {dadosSession.whats_suporte && dadosSession.perfil_admin == 'Sim' ? (

                    <View style={styles.positionButtonWhats}>
                        <FloatingAction
                        floatingIcon={<Image source={require('../../assets/buttons/whats-suporte.png')} />}
                            color="white"
                            actions={actions}
                            onPressItem={name => {
                                if(name == 'bt_financeiro') {
                                    sendWhatsAppMessage('financeiro');
                                } else if(name == 'bt_suporte') {
                                    sendWhatsAppMessage('técnico');
                                }
                            }}
                        />
                    </View>

                ) : null}

            </LinearGradient>

Plugin version:
"react-native-floating-action": "^1.22.0",
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.3
wanted: 0.76.3

Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true

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