santomegonzalo / react-native-floating-action

Material design action button for React Native
MIT License
489 stars 180 forks source link

onPressItem not working in New Arch #232

Open ademir10 opened 1 day ago

ademir10 commented 1 day ago

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