课程: React: Creating and Hosting a Full-Stack Site
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Using React Router links - React.js教程
课程: React: Creating and Hosting a Full-Stack Site
Using React Router links
- [Instructor] All right, so at this point we have four separate pages in our blog site, but it would be nice if we could navigate between these things without having to actually type in the URLs up at the top of the browser. So what we're going to do in this video is we're going to create a NavBar component that will be displayed on all of the pages. So the first thing that we're going to do is we're going to say New file, and we'll create a new file called NavBar.jsx. And inside here, we're going to say export default function NavBar. And we'll just cut right to the chase and start implementing this thing. Here's what our NavBar is going to look like. We're going to say <nav> and use that semantic nav element there. And then inside this, we're just going to use an unordered list with list items for each of the links that we want to add up here. Now for now, we're only going to have links for the homepage, the about page and the articles list page. The article detail page, as I said,…
内容
-
-
-
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 秒
-
-
-
-
-
-
-