Comments

The comments section will contain all the comment related elements in the Comments component and will get props such as the postId, and the comments data, along with a state updating method that can be called when a comment is added or deleted in the Comments component.

mern-social/client/post/Post.js:

<Comments postId={this.props.post._id}           comments={this.state.comments}           updateComments={this.updateComments}/>

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.