I'm getting a weird error of unreachable code detected in the return statement of ReactJS.
In the code snippet given below, the error is shown at the div with the button component.
How can I resolve this issue?
function RenderComments({ comments }) {
return (
comments.map((comment) =>
<div>
<ul className="list-unstyled">
<li className='font-quote'>{comment.comment}</li>
</ul>
<ul className="list-unstyled">
<li className='font-author'>--{comment.author}, {comment.date}</li>
</ul>
</div>
)
<div className = "row m-1" >
<Button type="submit" value="submit"><i className="fa fa-pencil"></i> Submit Comment</Button>
</div>
);
}
row m-1. Kindly check my answer for a working code.