From the course: MERN Essential Training (2020)
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Finalize the form
- [Instructor] Now, let's finalize the code for the form by adding all the proper functions required and testing the application. Again, as a note, I've only added a few elements for the fields for our players but only to make sure you're not going to see me add all these elements on screen, which is repetitive. Feel free to add them yourselves on your application. Okay, so let's go back to the PlayerForm and now we're going to do the functions. So the first thing I'm going to do is remove the constructor, so we're not going to need the constructor, and I'm going to add the submitPlayer function that we need here. So submitPlayer, which will take an event, and then we're going to prevent the default behavior, which is basically refreshing the browser automatically, so we're preventing that, and then we'll use axios. So we need to import it here first, so let's go ahead and do that, so import axios from axios, and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Add a styling library and folder structure6m 9s
-
(Locked)
Add the main page structure6m 21s
-
(Locked)
Add the state and Axios7m 10s
-
(Locked)
Create the listing component5m 21s
-
(Locked)
Create the single item component9m 25s
-
(Locked)
Add the form base structure6m 34s
-
(Locked)
Finalize the form7m 18s
-
(Locked)
Extend the application1m 52s
-
(Locked)
-