Skip to main content

useRouteRef()

Home > @backstage/core-plugin-api > useRouteRef

React hook for constructing URLs to routes.

Signature:

function useRouteRef<Optional extends boolean, Params extends AnyParams>(routeRef: ExternalRouteRef<Params, Optional>): Optional extends true ? RouteFunc<Params> | undefined : RouteFunc<Params>;

Parameters

ParameterTypeDescription
routeRefExternalRouteRef<Params, Optional>The ref to route that should be converted to URL.

Returns:

Optional extends true ? RouteFunc<Params> | undefined : RouteFunc<Params>

A function that will in turn return the concrete URL of the routeRef.

Remarks

See https://backstage.io/docs/plugins/composability#routing-system