Router Components

Developed with
QA

The course is part of this learning path

ReactJS: Zero to Hero
course-steps
14
certification
7
lab-steps
3
description
1
play-arrow
Start course
Overview
DifficultyIntermediate
Duration22m
Students86

Description

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.  

Prerequisites

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.

Feedback 

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

Transcript

If you wanted to find links to routes, the a tag isn't going to work for us. The link component generally replaces the anchor tag, wherever you want to create a hyperlink in your application. The traffic tribute should be replaced with the to attribute. And this can be either a string, an object, or a function. If you use an object, it could have any of these four properties defined: pathname, search, hash, and state. If you use a function, the current location is passed to the function as an argument, and the function should return a location, which could be a string or an object. Or the property's link component could have replace, which the building, that when true, means, clicking the link replaces the current entry in the history, instead of appending to it. In a ref, this is a function and it's there for legacy purposes. And others such as title, id, class name, and any of the props you'd like to be on the vendor anchor tag. However, it's often better from a stylistic point of view to use a special version of the component called Navlink. This hard start, contributes to the rendered element, when the URL is matched. Those attributes are activeClassName. This is a string for the CSS class name to be added to the element when it is active. Active style is just an object that defines a number of styles that answered the element when it's active. If you supply exact, the active style will only be applied if this is set to true and the location is matched exactly. Strict, is another Boolean that defines if a match should be made if there is a trailing slash on the location. isActive, is a function to add extra logic to determine if a link is actually active. It's used to calculate if more than the link's pathname matches the current URL's pathname. Location is an object which can be used to compare a different, different location than when using isActive. An area current allows you to set a string value to page, step, location, date, time, or true. Look in the documentation for what they mean.

About the Author
Students2857
Labs8
Courses29
Learning paths6

An outstanding trainer in software development with more than 15 years experience as a Corporate and Apprentice Trainer, ICT Teacher and Head of Department, with a passion for technology and its uses. Continuing to develop existing and new skills and courses, primarily in web design using PHP, JavaScript, HTML, CSS and SQL but also OOP (Java), programming foundations (Using Python), DevOps (Git, CI/CD, etc) and Agile/Scrum. Practically minded, a quick learner and a problem solver with an attention to detail to ensure high quality outcomes.

Covered Topics