useParams

Params are placeholders in the URL that begin with a colon, like the `:id` param defined in the route in this example. Parameters can be suffixed with a question mark (?) to make the parameter optional. useParams() returns an object of all the params matched by the current route (and any of its parent routes, for nested routes).