I have a created checkbox to each of MenuItem in a MUI Menu. And a user can select more than one menu item at a time.
Is there a way to get the selected menu item values ?
Because if I put event.target.value it is giving me on in my alert statement.
https://stackblitz.com/edit/react-avdghj?file=Demo.js
Kindly guide me on how to achieve this. Any help is much appreciated
Thanks
You can create a state that keeps track of the selected menu items and update it whenever a menu item is clicked.
I also added a
useEffectto log selected items whenever they change