Fixing the Router for the Property Management React Application
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

[00:00:01] Welcome back to the yacht in the sky. We set up our history not push the newsletter inner history component but you'll notice that it's not working. And the reason being is because when we are pushing history and it changes the newsletter using a different history object than what our routers using our our strapper out here. So what's happening is breezing browser router which has its own history object and then we have this history object which we're using in our index here actually. So what we have to do is simply just use the same one so we have this set up let's just go replace router or bootstrap with a browser router with routers and then let's import router insert and browser router and almost change the history object. So history is equal to say history and the import it. So let's say do Republican policy import history from Dasar history. So it's going to grant the same history object and then we're going to be pushing to the same history on the router. So let's go over here to Exxon and Let's type in our admin credentials stack password and then sign in and it navigates us to our newsletter component. Okay. So in the next guide we will be learning how to save our tuck into local storage so we can make it so we can only visit this route if we have a valid token. So I will catch the next guy where we will do that will go and get our code status get the a fixed history around history. Yeah. And real quick I just want to say we're not going to hide. [00:01:56][115.3]
[00:01:57] We're not going to check if the token is Dollon on newsletter. But what we'll do when we get to newsletter is we're going to want to fetch some data of the newsletter and then when we fetch these newsletters we're going to passing that token with the request and then basically if it's not valid it's not going to give us these objects. It's not going to give us this data so we'll still get the newsletter around but we don't have any data. So it's protected all right because it's protected on the backend and that requires that token to authorize us to see that we're authenticated. So we'll be doing that not Geim and then we'll get on to developing the rest of this newsletter component from them. So I'll see. [00:01:57][0.0]
[115.3]