peacensa.blogg.se

React router dom 5.2 0
React router dom 5.2 0










react router dom 5.2 0

Okay, so basically the best react component we've ever made, can probably end the course on this, no, I'm just kidding. And then we're going to export default, Details. So let me say const details equals arrow function, return an h2 of high or whatever you wanna say. This would be if I click on Luna I wanna see all the details about Luna. So create a new file in your source directory called details.js. And the first thing I want you to do is I'm going to go create a new page called details. Okay, so now we should have react router DOM. It's the Windows version, right? They also have a React Native version and we only care about the dom version right now. And I'm gonna say npm install react-router-dom. So come back over to your page here, and I'm just gonna create a new terminal here. We're gonna look at the package JSON and we're going to get react router Dom 5.2.0. So let's go ahead and make sure that we get the correct one. So the first thing that we wanna do, Let's go install our version of react router that we want. But we won't be able to switch between the two different pages, right? We wanna have a SearchParams page and we wanna have a details page. If we head back over to our app.js, you can see we have a search params route. Okay, we already have one route in our application. But yeah, we're gonna be talking about react router version five today. They're not that different and for the purposes of this course, it doesn't actually vary that much, in version five of this course I taught reach router, and updating that to react router version five didn't take a lot of work. So look forward to taking the intro to react to these seven, I'm sure we'll cover that.

react router dom 5.2 0

And I'll say that react router six is about to come out, and there's gonna be some variation from that as well. So in this particular case, we're gonna be teaching react router five today. And they're require rewriting your application can be a bit of a point of frustration, but it's also by far the best router. And the one thing that I'll say about react router that might be a minor frustration to some of you is the version three, version four and version four, for version five or wildly different. > So in previous versions of this course I taught older versions of react router and reach router.

react router dom 5.2 0

Transcript from the "React Router Route" Lesson












React router dom 5.2 0