-3

<Button onClick={(e)=>setId(_id); handleDelete()}>Delete

I tried this way, but it gives error.

shahnmah
  • 1
  • 4
  • [This](https://stackoverflow.com/questions/3910736/how-to-call-multiple-javascript-functions-in-onclick-event) will solve your problem . – DimitrijeCiric May 14 '22 at 15:42

1 Answers1

-1

I think you must wrap the content of the arrow function in { }, like this

<Button onClick={(e) => {setId(_id); handleDelete()} }>Delete</Button>

and don't forget the closing tag for the Button component

I hope that solves your problem.

Hassan
  • 66
  • 4