Primitives

useParams

Edit this page

useParams retrieves a reactive object similar to a store. It contains the current route's path parameters as defined in the Route.

const params = useParams();
// Route path: /user/:id => /user/123
console.log(params.id); // 123
Report an issue with this page