From the course: MERN Essential Training (2020)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add the state and Axios
- [Male] So let's work on creating our state for the entire application. So the first thing we're going to do is go back to the terminal, and install another package. So, let's go to the terminal, actually we could do just Control + ', and then turn this one down by doing Control + C, and we're going to be doing npm install axios, and that's a library that will allow us to do calls to the APIs, but with simple syntax. Okay, so now that we have the Axios library installed, we can start the application again, so npm start, close this down, and then we're going to do a lot of refactoring here, just to make sure that we are first, using a class component here, so the first thing we're going to do is class, and then remove the parenthesis, and then do extends React.Component, like so, and then inside of that class, we're going to add a render method, open curly braces, and then close it at the end, right here, like so…
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)
-