useRouteParams

The useRouteParams hook retrieves the parameters of an active route. The hook is available in both server and client components.