How to trigger Button onPress
programmatically?
#6280
Unanswered
THOUSAND-SKY
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Is this for a test? If so, I'd suggest looking at our tests. If this is for an actual interaction, then I'd just call whatever function you're passing to onPress directly. No need to trigger events. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a button using
onPress
, and from non-react code I'd like to trigger the click, butel.click()
(nor aref.current.click()
for that matter) doesn't actually trigger it. Is there a simple way of triggering a press event, like.click()
would do foronClick
?Beta Was this translation helpful? Give feedback.
All reactions