In this video, learn how to finish the PostForm component and wire up a submit handler so the form can post status messages to the API you’re using.
- [Narrator] In this video, we're going to … connect the post form to the API, … adding the submit handler that … will post new status messages. … Over here in my post form component, … I'm going to scroll down to the form field. … And we're going to add an on submit handler. … That way, however we submit the form, … our handler will be triggered. … We'll call this post status update. … It's a function we're going to need to define. … And to save having to watch me do a lot of typing here, … I've included a snippet in the exercise files … for this video with all the code that we can copy and paste, … and then we'll talk through what it's doing. … So, we'll paste that in. … So this is an event handler that … takes an event as its argument. … First we prevent the default actions … so the page doesn't reload when we submit the form. … And we create a new status object. … This takes the message text and type from our form state … and saves them to fields called message and type, … which are what the API uses. …
- Installing React on an existing site
- Thinking about a design in terms of components
- Creating fully-featured function components using Hooks
- Storing and retrieving data from an external RESTful API
- Employing third-party components for CSS animation
- Using conditional rendering
Skill Level Intermediate
Essentials of CSS for React Developerswith Eric Greene53m 31s Beginner
React.js Essential Training (2018)with Eve Porcello1h 25m Intermediate
Using the exercise files1m 2s
1. Introducing React
2. First Project: Customizer
3. Second Project: Directory Browser
4. Third Project: Status Updater
- 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.