I try to trigger the handleClick function when i click on my Trash component, but it doesn't work because Trash is not a DOM object. How can i trigger my function when i click on this component ?
const handleClick = () => {
console.log('OK');
}
return (
<div className="comment">
{trash && <Trash comment={comment} onClick={handleClick} />
</div>
);
Trashcomponent? Without that code, we can't understand whyhandleClickisn't being called.