State Management · Junior · Question 68 of 75

How do you read the :id part of the URL /users/:id in a React Router component?

Explanation

Params are always strings, so convert them if you need numbers. In loaders they arrive as params in the argument.

Further reading

Problem with a question

State Management · Junior · question 68

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz