Setting Up Routing to Newsletter After Sign In
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

[00:00:00] Welcome back to the reactor. And this guy we are going to be navigating our user to slash newsletter so they can view the newsletter so we can do this. After signing in is by going to our app and well the it's going to happen the way we're going to be now getting the newsletter once the user sign is going in here and we need to create a file in our source was called this history digests. And then in here we are the import create browser history from create or from history. And then we just have to say export default line called create browser history as a function. Now in our actions all we have to do is say import dot dot slash and then say history. So we're getting this and we want to say import history from industry and we're getting function create browser history and then we are basically making it so we can navigate our history. So we have to do is once we sign in we want to say okay we signed it and we were token now we need to push to newsletter's solvency history. Don't push slash newsletter save that let's go here. That's remold. Let's add in our e-mail and password right quick and let's give him a password password and it's. Notice a complete request and them are pushed to newsletter. So let's write a component and Graig and get that set up so we can see something when we push. We also want to set up a route so we can actually go somewhere. [00:01:48][107.8]
[00:01:49] So let's head to our bootstrap digest and carry it around let's say newsletter and we want it to be a component newsletter. Now we want to import this so let's say import we haven't written this yet. So in word newsletter from and then you don't want to put it in dot slash components slash newsletter slash newsletter. So let's go ahead and read that directory directory not components and say new folder on components. Here's a letter and then and here let's just throw in a newsletter. Yes. Given our basic component structure import React component from react a Class Newsletter extends Component render return newsletter component. Can I just say thanks for the default newsletter. Can you save it and head over to the browser. It's not gonna work because we spoke components wrong so I'm going to head back to bootstrap and say components and that should work now through the page and router needs loaded about so try any analysts say in and then I'm going to put in admin and then I'm going to put in password and an ominous sign in. We get our token Pushtu newsletter but it has not worked. Let's see we had slash newsletter. We hit enter a reloads. That's how you set up. We'll fix that in the next guide. After we talk a little bit about what we're going to do with this seems like important. So what's community codes and good status good had good a newsletter Rouch and you already know it. OK so let's go ahead and hop into my next guest CNN. [00:01:49][0.0]
[107.8]