The course is part of this learning path
This module looks at how to Route in React. You’ll be looking at linking components, creating dynamic links, parameterized routes, and how to install the React Router DOM.
The objectives of this module are to provide you with an understanding of:
- How to install the React Router DOM
- Hooks in React
- How to create restful services
- How to use an Effect Dependency Array
- How to hand errors in data requests
- How to send data
This learning path is aimed at all who wish to learn how to use the ReactJS framework.
We welcome all feedback and suggestions - please contact us at email@example.com to let us know what you think.
- [Narrator] Remember, the routing is seen as part of the UI, so we can make any component render wall. That's what we've done as parts of the Filterable Courses Table and why the course component renders underneath it, so creating nested routes is easy. Just to finish off on the general routing, we've also added a route to the up component with the path of /courses on line 31 on the right hand side of the screen. This is so we match any route on the courses' path and don't follow our cultural redirect. We're about to parameterise routes. The thing that creates the parameterised routes, is in the path of the route component on line 86 on the left hand side of the screen. The path is just an evaluated template literal string. This the call on though is crucial. This makes this part of the path a parameter and this will be inserted by the link that calls the route. Under that, we just render a course component, passing in the course array as a prop. Now we have a link that supplies the parameter and a route that can recognize it. How do we make the course component aware of that value to display the correct course? That's coming up next.