How to Create Dynamic Links

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
Students106

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

Creating a link for each of the course names isn't too onerous a job. It's done where the course name is rendered. That'll be in the CourseRow component. You can see that we've surrounded the course's name in the table cell with a link component. Obviously, we've imported that from react-router-dom. Look at how the to attribute is constructed though. We use a JavaScript expression as its value. We make the value using a template literal string with backticks providing the initial part of the route. That's slash courses slash. We then interplay the value course Id to the end of it. You'll notice that we've deconstructed the course prop to make the code look cleaner. So every course row returned will have a different link created provided that unique Ids have been used in the data supplied. The next step is to create a route that recognizes the end of this link path as a parameter.

About the Author
Students3028
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