Learn about using React Router's Link component.
- [Instructor] Okay, now our NavDrawer…has some functionality.…It can open and close,…but these links that we had here in the drawer,…they don't do anything…and I think I'd like it for when I click on them,…for them to also open or close the NavDrawer.…So, I'm going to go back into my NavDrawer.js file…and here on line seven, I'm going to import a component…from router that I want to use.…This is called link.…Link is a prebuilt component that will make it easier…for me to do internal links within my site.…
And then,…here on line 44, I'm going to wrap my menu item…with the link component.…So, I'll create it and then I'll close the link.…And then I'm going to copy and paste menu item…and put it within link as a child.…I'm going to do the same thing around my other menu item,…here on line 49.…Create the link, close it,…then copy and paste menu item onto line 50,…so that it's a child of the link.…
Now, to make these links functional,…I need to specify a prop to,…which is going to tell it which URL to navigate to.…Since play is on my root wrap,…
- Installing local dependencies
- Generating a starter project
- Deploying to Heroku
- Planning your development process
- Using styled-components
- Styling for mobile
- Setting up models on Graphcool
- Creating Relay mutations
- Adding Relay to your authentication flow
- Protecting routes with authentication
Skill Level Intermediate
2. Deployment Environments
3. App Functionality
4. Implementing Libraries
5. Creating Components
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.