In the last section we discussed the API that we'll be using for our application. 2
Again we're not going to make use of it right away. 3
So just hold that knowledge in your head for a little bit. 4
It's really a lot easier to cover now rather than to break our concentration later on. 5
So back to the task at hand. 6
I'm going to pull our blog post mock up open again one of the topics that we discussed about this application 7
is how we need to give the user the ability to navigate to different pages within our application in 8
particular when we navigate around the URL at the top of the page you know in the address bar needs 9
to be updated to reflect our current location within the app. 10
What's more is that when a user navigates to a particular you are l like say post slash 5 as we see 11
right here. 12
We need not only make sure that we show the correct components to the user on the screen but we need 13
to show them the correct content as well. 14
So in this case I'm expected to load the blog post with ID 5 and show it to the user. 15
And when the user say bookmarks that you are l and two weeks later navigates back to this page they're 16
going to expect to see the exact same blog post pop up on the screen. 17
So we need to make sure that our URLs are consistent in not only showing the same components on the 18
screen but also the same data. 19
So to help us build our app in this manner we're going to make use of a library called re-act router 20
. 21
So we're going to start off this application by just immediately start installing the library. 22
So I'm at the command line inside of our project directory and I'm going to install this package by 23
running NPM install dash dash save re-act router and then we're going to install a very particular version 24
of it so don't hit enter just yet. 25
So we're going to do an at sign and then two point zero point zero dash RC 5 OK. 26
So it's you know unfortunately we have to install a very particular version of re-act router. 27
But the unfortunate truth is that we are forever in the past has had a pretty bumpy API where their 28
API kind of changes from version of version a lot. 29
And you know it kind of breaks between different versions. 30
So just to make sure that we're on the same version we're going to get the you know install a very specific 31
version right here. 32
OK. 33
Now that we've got this installed Let's go ahead and continue in the next section.