Using Route Parameters

Learn to navigate to the question page using the Route component.

In this section, we are going to define a Route component for navigating to the question page. This will contain a variable called questionId at the end of the path, so we will need to use what is called a route parameter. We’ll implement more of the question page content in this section as well.

Adding the question page route

Let’s carry out the following steps to add the question page route:

  1. In App.tsx, import the QuestionPage component we created earlier in this chapter:

Get hands-on with 1400+ tech skills courses.