Support onSelect for each MenuItem within Menu component #1385
Closed
codepath2019
started this conversation in
Ideas
Replies: 1 comment
-
I realized that one possibility is to just attach |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, 👋
I am building a menu component using
Menu
. The requirement is that when I click on a menu item, a specific callback is invoked.At the moment, the handler for when a
menuItem
is clicked is passed toMenu.onSelect
. As a consumer of theMenu
component, I'd like to attach a callback directly to each of theMenuItem
instead. Otherwise, I believe, I'll have to write branching logic to determine based on thevalue
of the callback toMenu.onSelect
, then decide on which of the callbacks to invoke. Does anyone in the Ark community feel the same? If not, could someone help me understand what it is that I am missing. Thank you! 🌟If possible, I'd like to avoid the following boilerplate
Beta Was this translation helpful? Give feedback.
All reactions