From the course: React: Securing Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add connections to server

Add connections to server - React.js Tutorial

From the course: React: Securing Applications

Start my 1-month free trial

Add connections to server

- [Instructor] Okay so now let's work on the main file, the app.js, so go back into the client project, and go into components inside of source, and open up app.js. So the first thing we're going to do is fix our imports and make sure we have everything that we need. So, the first thing that I'm going to do is import axios 'cause we're going to need that. So let's go and import axios from axios. Perfect. Now, we're going to also import, useAuthO from react-auth-spa, like so, and then we'll also import our history, there's a lot of stuff that's going to happen directly inside of app that's why we're focusing only on that one for now. And now we're going to import our history file, like so, 'cause we're going to need it with our react router. Now the next thing we're going to need to do is first remove import data, so we're not going to need the data from there anymore, and we're also going to import the loading that…

Contents