April 2020
Intermediate to advanced
716 pages
18h 55m
English
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.
The comments section will be rendered in the view with the following code.
mern-social/client/post/Post.js:
<Comments postId={props.post._id} comments={values.comments} updateComments={updateComments}/>
The implementation of this Comments component will be detailed later in this chapter. These four sections make up the individual post view that we implemented in the Post component, which is rendered in PostList component. Each post's header also shows a delete button ...
Read now
Unlock full access