How to get the attribute of Material-UI Button?. I've tried the getAttribute() but it gives me null. I know this is possible using normal <button> tags but I want to try using Material-UI button.
My button-
<Button
variant="outlined"
id={button1}
button-key="buttonAttribute"
onClick={this.isClicked}>
MyButton
</Button>
click function -
isClicked = (e) => {
const attButton = e.target.getAttribute('button-key')
console.log(attButton)
}
My console returns null.
How can it return buttonAttribute