You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's how I achieved providing onPress events for dataComponents 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 from react-native, quite a standard way to render an image in a react component.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
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