0

I have multiple button on the screen , I want that user either click this button to route to the new item or user could have close this , for that i have given the close icon within the button so that user can close that if they want , but when i am trying to give onclick function to the icon within the button it does not work

how could i do that ???

Here is the demo code

https://codesandbox.io/s/material-demo-rbkr8

Bilawal
  • 244
  • 5
  • 19

1 Answers1

0

try wrapping it with a div onClick like this?

const doSomething = () => {
  alert('click here');
}

<div onClick={doSomething}>
      <DeleteIcon className={classes.rightIcon} />
</div>
Kimberlee Ho
  • 447
  • 1
  • 6
  • 23