useRouteParams
The useRouteParams
hook retrieves the parameters of an active route. The hook is available in both server and client components. For example, if your file route has the name [handle].server.jsx
, then useRouteParams
returns an object with a key handle
inside it.
Example code
Anchor link to section titled "Example code"
Return value
Anchor link to section titled "Return value"The useRouteParams
hook returns an object with key values for each matching route parameter.