课程: React: Creating and Hosting a Full-Stack Site (2022)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
URL parameters with React Router
课程: React: Creating and Hosting a Full-Stack Site (2022)
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.…
内容
-
-
-
Why React?3 分钟 27 秒
-
(已锁定)
Setting up a React project5 分钟 34 秒
-
(已锁定)
Creating the app component4 分钟 3 秒
-
(已锁定)
Creating your blog pages10 分钟 1 秒
-
(已锁定)
Using React Router links5 分钟 36 秒
-
(已锁定)
URL parameters with React Router9 分钟 29 秒
-
(已锁定)
Creating and linking the articles list8 分钟 45 秒
-
(已锁定)
Making your articles list modular5 分钟 18 秒
-
(已锁定)
Creating a 404 page in React8 分钟 10 秒
-
-
-
-
-
-
-