Join Shaun Wassell for an in-depth discussion in this video Adding an Add Comment form, part 3, part of React: Creating and Hosting a Full-Stack Site.
- Now, the response that we get back from our server, … which we've called Resolve is going to contain … the updated version of our article info, … which we can use to update our UI once we get the response. … This is the same thing that we did with our Upvote button. … So first we need to get the body of the response, … which will do by saying const body … equals await, … and then we're going to want to call set article info … with the updated info in the body. … We'll say setArticleInfo, body. … Now our AddCommentForm component … doesn't have this function yet, … so at some point we're going to need to pass it down … from the top level article page component. … So first let's define the props setter … AddCommentForm is going to need. … Remember that it will need this article name prop … pass down to it, … so up here we'll say, articleName, … and it will also need the setArticleInfo function pass … down to it. … So we'll say setArticleInfo, … and then we want to actually call this asynchronous …
- Creating the app component
- Using React-Router links
- Setting up an Express server
- Route parameters in Express
- Adding the comments functionality
- Installing and adding MongoDB to your project
- Rewriting the endpoints
- Adding React hooks
- Adding buttons and forms
- Pushing code to GitHub
- Running a full-stack app on AWS
Skill Level Intermediate
1. Creating a React Front End
2. Creating a Node Back End
3. Setting Up MongoDB
4. Connecting the Front and Back Ends
5. Hosting the Site
Next steps1m 17s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.