Route Components

Developed with
Start course

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.

Learning Objectives 

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   

Intended Audience  

This learning path is aimed at all who wish to learn how to use the ReactJS framework.  


It is essential you understand the face of contemporary web development to attend this course. You should also have JavaScript experience, along with good HTML and CSS skills.


We welcome all feedback and suggestions - please contact us at to let us know what you think. 


- Now that we have the navigation links in the app, we want the views to actually change when we click on them. But that's the job with the route component. The route component is from the react query to DM library. It's used to define which component tree should be rendered when a particular location matches the route path. This component is one of the most important to understand, if you want to add route into your app. It can receive some props when it's used. These are paths, a render method, and some other options. The path isn't anything more than the part of the URL we want this route to work with. Usually, you'll define a route component for every two attribute you're using your application. The path is defined as a string or an array of strings. The easiest and recommended way to render from a route is to our child components to it. However, there are three other ways to render from a root. These are considered legacy, as they were the way to render on routes before Hawks were introduced. You can supply a component's tribute with the name of the component to rendering curly braces. You can use the render attribute. This requires a call back the return to component, or you can use the children attribute, which is useful in animations. As you can render on this route, whether the path matches the location or not. The options that can be supplied, make the route more specific. Using exact means that the root will only match, if the path supplied matches location, pathname exactly. Adding strict means that paths where the trends slash included will only match a location's pathname that has a trailing slash. Strict has no effect, if there are additional URL segments in the location's pathname. Supplying a location prop needs it's value to be an object. When matching a root, it uses the current history location and the paths supplied. The location prop allows for a location with a different pathname to be matched. As with the children render method, this is useful in animations. The final option in the API for route is sensitive. When used, it defines that the path and the location pathname must be a case match as well.

About the Author
Ed Wright
Senior Learning Consultant
Learning Paths

Ed is an Outstanding Trainer in Software Development, with a passion for technology and its uses and holding more than 10 years’ experience.

Previous roles have included being a Delivery Manager, Trainer, ICT teacher, and Head of Department. Ed continues to develop existing and new courses, primarily in web design using: PHP, JavaScript, HTML, CSS, SQL, and OOP (Java), Programming Foundations (Python), and DevOps (Git, CI/CD, etc). Ed describes himself as practically minded, a quick learner, and a problem solver who pays great attention to detail. 

Ed’s specialist area is training in Emerging Technologies, within Web Development. Ed mainly delivers courses in JavaScript covering vanilla JS, ES2015+, TypeScript, Angular, and React (the latter is authored by Ed) and has delivered on behalf of Google for PWAs. Ed has also developed a new suite of PHP courses and has extensive experience with HTML/CSS and MySQL. 

Ed is responsible for delivering QA’s Programming Foundations course using the Eclipse IDE. His skillset extends into the DevOps sphere, where he is able to deliver courses based around Agile/Scrum practices, version control, and CI/CD.

Covered Topics