If I go to about, our time has updated to 034:03 because we've actually completely refreshed the browser, which means that this force refresh was called again. We can see that we've called force refresh which has returned the value of true. Over here in the browser I'm going to load up our dev tools. I'm going to return true, but I'm also going to log out a new date string. Of course we need to eventually return a true or false here. I'm actually going to set it to a function and we're going to call that directly here. Along with that we do get a couple options here, so one is force refresh. This router is meant to be used in environments where we can support the HTML5 history API. Here in the browser we have our home link and our about link. Then we'll go ahead and export that by default. Inside of that we're going to have our links routes component. We're going to output a browser router component. We're going to create a new component here called browser router app. I've got a component here called links routes which has a couple of React Router links as well as React Router routes tied to those links. I've imported that from our React Router DOM library. React Router provides us with a number of preconfigured routers that we can use, the most common of which is browser router.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |