Skip to main content
useParams is a Client Component hook that lets you read a route’s dynamic parameters as filled in by the current URL.
app/example-client-component.tsx

Parameters

useParams takes no parameters.

Returns

An object containing the current route’s filled-in dynamic segments.
  • Each key is a dynamic segment name.
  • Each value is a string (for [param]) or string[] (for [...param]).
  • Returns an empty object {} if the route has no dynamic segments.
  • Returns null when used in the Pages Router before the router is ready.

Example

app/product/[id]/edit/page.tsx

Version history