export default function Comment({ index, onRemoveComment, children }) {
function removeComment() {
// console.log(" ... removeComment calls onRemoveComment ...");
onRemoveComment(index);
}
//
return (
<div className="comment">
<p>{children}
<span>
<button onClick={removeComment} id="removeComment">
Remove</button>
</span>
</p>
</div>
)
}
I tried changing where I placed id for the remove comment, but I am not sure where to add the id of comment.
New contributor
Gabby is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1