-3

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

I tried this way, but it gives error.

1
  • This will solve your problem . Commented May 14, 2022 at 15:42

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.