Data Components with images supporting onPress events in React Native #2636
ardentcricket
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's how I achieved providing onPress events for
dataComponent
s being an image in react-native.Issue:
The onPress event wasn't working for a dataComponent that had an image, similar to what is shown below.
I was using the
Image
tag fromreact-native
, quite a standard way to render an image in a react component.Resolution:
The
Image
tag fromreact-native
is not compatible with react-native to support an onPress event.After the
Image
tag fromreact-native
was replaced with theimage
tag fromreact-native-svg
, it worked like a charm.Time consuming lesson learned. Hopefully this is of help to someone.
Beta Was this translation helpful? Give feedback.
All reactions