Skip to content
Justice Tech School

Route Parameters

useParams reads dynamic URL parts.

Example
<Route path="/users/:id" element={<User />} />;
function User() {
  const { id } = useParams();
  return <p>User {id}</p>;
}

Exercise

Read params.

const { id } = ()

Quiz Test

How is a dynamic segment written?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.