Add onClick/onPress to MenuItem #5459
Unanswered
jhowell-droit
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Please see discussion here #5058 (reply in thread) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using React Aria's Menu component to build a popover style menu in my design system. When using it in an application, we need to be able to trigger Javascript when certain menu items are clicked. I notice that there is an
onAction
method for theMenu
component itself but that suggests an event which fires when any of the items are clicked. I would like to be able to effectively add an onClick or onPress event to the individual MenuItems in order to apply different actions to each one. Is this possible? I am wrapping the MenuItem component in my own React component so I have tried spreading an onClick event into the props but this didn't work.Any help would be much appreciated,
Thanks
Beta Was this translation helpful? Give feedback.
All reactions