React Material-UI Multiselect with checkbox ccannot select all
I did a few fix in your code so it works, in this sandbox:
To display some text in your menu, you are supposed to display the text in the component ListItemText
:
<ListItemText>{option}</ListItemText>
An other thing is that you cannot access selected
directly, since it is a state, so it is set asynchronously. To solve this, you can simply access it like this:
selected?.length
This way, even if selected is still undefined, it will not throw any errors