课程: React: Creating and Hosting a Full-Stack Site
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
URL parameters with React Router - React.js教程
课程: React: Creating and Hosting a Full-Stack Site
URL parameters with React Router
- [Instructor] All right, so at this point, we have a NavBar that allows us to go to three of the pages in our application, but we still need to be able to access the individual ArticlePage and display multiple articles using that page. So here's how this is going to work. First of all, we're going to need to go back to our app component, and the routes that we defined, and make a slight change to the path that we defined for our ArticlePage. Instead of saying /articles/individual, we're going to say /articles/, and then we're going to use a colon followed by name, all right? Now, this is what's referred to as a URL parameter, or a route parameter, and basically, what this colon name thing allows us to do is catch all routes that start with articles and have something else after them, so, in our case, this could be /articles/123, or if it's the article's name, as you'll often see on blog sites, such as /articles/learn-node, for example, or /learn-react, then this page is going to be…
内容
-
-
-
Why React?1 分钟 42 秒
-
Setting up a React project6 分钟 8 秒
-
Creating the home page3 分钟 50 秒
-
(已锁定)
Adding React Router to an application8 分钟 33 秒
-
(已锁定)
Using React Router links9 分钟 21 秒
-
(已锁定)
URL parameters with React Router9 分钟 9 秒
-
(已锁定)
Creating and linking the articles list7 分钟 8 秒
-
(已锁定)
Creating a 404 page in React4 分钟 4 秒
-
(已锁定)
Adding styles2 分钟 16 秒
-
-
-
-
-
-
-