This video explains how to get data from the URLs to create dynamic routes.
- [Instructor] Hi, in this video we are going to talk…of how to access URL params from inside our components.…And the way of showing this is by creating…a new route inside of our application,…which will be the recipe detail route.…The recipe detail route will be very simple.…The interesting part about this route is in URL.…If you have server, the URL will be /recipe/id.…What we want to do inside our application…is to dynamically load the recipe…with the past ID in the URL.…Inside this route, we are going to reuse…the recipe detail that we created before.…Okay, so let's jump to our code editor…The first thing we're going to do is to…create a new component to render our page.…
So create a new file called recipe.js.…Inside of it, remember to always import react,…and create a new class component called recipe.…Remember to include the render method…and return just a div for the moment.…And remember at the end, export the component.…
Cool, let's just render some dummy text…to test if the page is working.…Now, let's go to our APP JS component…
- Structuring React projects
- Creating and mounting the root component
- Composing components for more complex UI
- Using state to making components dynamic
Skill Level Intermediate
React: Managing Complex Interactionswith Emmanuel Henri1h 45m Intermediate
1. How to Structure React Projects
2. Diving into the First Components
3. Styling Made Easy
5. Painless Components Testing
Configure Jest5m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.