I was unable to populate the
Here is the corrected file.
renderComments(){
if (this.props.selectedDish != null) {
const commentList = this.props.selectedDish.comments;
return (
<div>
<h4>Comments</h4>
{commentList.map((comment) => {
return (
<ul className="list-unstyled" >
<li>
<p>{comment.comment}</p>
<p> -- {comment.author}{" "}
{Intl.DateTimeFormat("en-US",{
month: "short",
day: "2-digit",
year: "numeric"}).format(new Date(comment.date))}
</p>
</li>
</ul>
);
})};
</div>
);
} else {
return (
<div></div>
);
}
}
Thank you sava128