This is an interview exercise that tests React and Redux knowledge.
The goal of this exercise is to create a comment box that can display comments and where users can post comments.
See the image here:
First things first, familiarize yourself with the project structure, maybe look at the npm packages, etc. CommentBox is the main component. Right now it loads comments and passes them to the CommentList component.
- CommentList needs to show the comments that are already there. Make a Comment component and show it for each comment.
- We need a way to submit new comments. Create a CommentForm component that will let a user post in new comments. Don't do anything with the data for now.
- Handle the form data. Using Redux, make the form emit an action with the data, then create a reducer that will add the comment to the list.