I have a react code where I added this function below that is running automatically. I don't need to click, it just runs.
How can I fix this?
function handleUpadeVacationStatus(id){
alert(id)
}
return (
<div>
{vacations.map( (vac) => {
return(
<div className="vacationDIV">
<div>
<p>{vac?.convering} is covering {vac?.underCover}</p>
<p>from {moment(vac?.startdate).format("L") } to { moment(vac?.enddate).format("L") }</p>
</div>
<div className="cancelVAc" onClick={handleUpadeVacationStatus(vac?._id)}>
<img src={trashimg} alt="Click here to delete vacation coverage"/>
</div>
</div>
)
})}
</div>
)