I'm using Material UI for Menu and Menu Item. I'm trying to get the value of a menu item, but it doesn't work.
This is my code :
<Menu value= { this.state.selectedItem }>
<MenuItem onClick={this.listClicked}
leftIcon={
<FontIcon
className="material-icons"
style={{ color: 'white', margin: '0' }}>
format_list_bulleted
</FontIcon>
}
/>
<MenuItem onClick={this.settingClicked}
leftIcon={
<FontIcon
className="material-icons"
style={{ color: 'white', margin: '0' }}>
settings
</FontIcon>
}
/>
</Menu>
public listClicked = (value) => {
this.setState({
selectedItem :value
})
console.log(this.state.selectedItem)
}
I don't get the value, and in the console of navigator I have an object.
Can you help me?
Thank you