From the course: React: Creating and Hosting a Full-Stack Site

Schalten Sie den kompletten Kurs noch heute frei

Join today to access over 23,400 courses taught by industry experts.

Creating an upvote button

Creating an upvote button

"

- [Speaker] All right, so far we've added some very nice fetching functionality to our front end. And as we've seen every time we visit an article page our client loads information about the article from the server, such as the up votes and the comments and those are displayed on the article page. Now all of this is great but the interaction between our front end and our back end right now is very one sided, right? In other words, our front end is just loading data from our back end, but there's not really any way currently for our front end to make changes to the back end. So what we're going to do here is we're going to add an up vote button next to this up votes message that will allow our front end to send a request to the server telling it to add an up vote to a specific article. All right. So let's head over to our IDE. And what we're going to do is open up our article page and inside here, pretty much anywhere…

Inhalt