Updating a Comment

Follow step-by-step instructions to implement the UI for updating comments under a post.

The deletion of a comment in our React application is now possible. Let’s move on to adding the feature for modifying comments.

Updating a comment will be similar to what was done in the UpdatePost.jsx file. To achieve this functionality, we will have to create a modal.

Adding the UpdateComment modal

Inside the src/components/comments directory, create a file called UpdateComment.jsx. This file will contain the modal and the form that will allow the user to update a comment:

Get hands-on with 1200+ tech skills courses.