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
Parameter |
Type |
Description |
---|---|---|
routeRef |
ExternalRouteRef<Params, Optional> |
The ref to route that should be converted to URL. |
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