Liking a Comment

Follow step-by-step instruction to implement the UI for liking comments under a post.

We'll cover the following

An exciting feature to have for the comments is the ability to like the comment. It is similar to what we have done for the posts.

Adding the “Like” feature to the “Comment” feature will require making some changes to the Django API and adding some code to the React application. Here is the final result.

Feature requirements

Here is a list of the requirements of the feature:

  • The user can see the number of likes on a comment.

  • The user can like a comment.

  • The user can remove a like from a comment.

This will require some tweaks to the Django API as well.

Run the given code and log in.

Get hands-on with 1200+ tech skills courses.