From the course: React: Creating and Hosting a Full-Stack Site
Schalten Sie den kompletten Kurs noch heute frei
Join today to access over 23,400 courses taught by industry experts.
URL parameters with React Router
From the course: React: Creating and Hosting a Full-Stack Site
URL parameters with React Router
- [Instructor] Okay, so now that we've added this lovely nav bar to our application, the next thing that we're going to want to do is actually start implementing the article page. Now, remember that the article page, what was different about it, if we go back to our app component where we defined our routes, what was different about this is that it had this little URL parameter thing here. Now, URL parameters are generally used in React when we want a single component to be able to display multiple different pages, right? So for our article page, it's a single component, but we're going to want this to be able to display all of the different articles in our application as if we had one page for each article in our app. So what this means is that what we're going to need to do is take this article ID when we're inside our article page component and use that to load the data for the correct article that matches this ID.…
Inhalt
-
-
-
Why React?3m 27s
-
(Locked)
Setting up a React project5m 34s
-
(Locked)
Creating the app component4m 3s
-
(Locked)
Creating your blog pages10m 1s
-
(Locked)
Using React Router links5m 36s
-
(Locked)
URL parameters with React Router9m 29s
-
(Locked)
Creating and linking the articles list8m 45s
-
(Locked)
Making your articles list modular5m 18s
-
(Locked)
Creating a 404 page in React8m 10s
-
-
-
-
-
-
-