callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.69k stars 2.07k forks source link

onPress Card don't work after upgrade Expo to 51 #4450

Open deck2k opened 1 month ago

deck2k commented 1 month ago

My code is

<Card style={[styles.buttonCard, styles.buttonColor]} onPress={() => navigation.navigate('Property', { ---some properties-- })}>

--some text-- This code in expo 49 is functionally, after upgrade, card onPress is disabled and dont show content of view (icons, text) If delete onPress , render view OK Thanks!
FouadMagdy01 commented 1 month ago

Dont make the Card component self-closed Put some content inside and the onPress prop should work as expected

This behavior also applies for the Button component

I haven't explored the reason for this behavior in the component code but this is how it works

Hope it solve your problem

deck2k commented 1 month ago

excellent! There I modified the code and it worked perfectly.

Thank you very much for the quick answer!

raajnadar commented 1 month ago

@FouadMagdy01 do you mean to reproduce this bug don't send children?

FouadMagdy01 commented 1 month ago

@FouadMagdy01 do you mean to reproduce this bug don't send children?

Yes, When not providing the children component in React Native paper Components the pressing functionality doesn't work at all

You can even notice that if you have Button component, the ripple effect on android will not trigger and also the onPress function