From the course: Building Production-Ready React Apps: Setup to Deployment with Firebase

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Use Link component to navigate between pages

Use Link component to navigate between pages

- [Instructor] Next, we create a navigation component to allow user interaction, then allow navigation between views. In this example, we want to create first, a navigation component, then display the user stock images, and finally, we want to create another page to display one single card with one stock image. So first, I'm going to import right here in this nav bar, file, I'm going to import from react-router-dom, the link component. And here, the goal is to create a navigation. So I'm going to replace all the anchor tag, like so. So now we have a new navigation component. And I must also specify where I want to navigate with this link. And this will be similar to the root url. So as we have specified, defined right here, in order to display the corresponding component, which is the root component. So let's do the same to display another root. I mean another link in this navigation. So the purpose is to give the user…

Contents