Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deck2k opened this issue Jul 11, 2024 · 4 comments
Open

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

deck2k opened this issue Jul 11, 2024 · 4 comments
Labels

Comments

@deck2k
Copy link

deck2k commented Jul 11, 2024

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!

@deck2k deck2k added the bug label Jul 11, 2024
@FouadMagdy01
Copy link

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
Copy link
Author

deck2k commented Jul 12, 2024

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

Thank you very much for the quick answer!

@raajnadar
Copy link
Collaborator

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

@FouadMagdy01
Copy link

FouadMagdy01 commented Jul 14, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants