课程: React: Creating and Hosting a Full-Stack Site

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Using React Router links

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,…

内容