Skip to main content
Version: Next

createRouteRef()

Home > @backstage/frontend-plugin-api > createRouteRef

Create a RouteRef from a route descriptor.

Signature:

function createRouteRef<TParams extends {
[param in TParamKeys]: string;
} | undefined = undefined, TParamKeys extends string = string>(config?: {
readonly params?: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[];
aliasFor?: string;
}): RouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : {
[param in TParamKeys]: string;
}>;

Parameters

Parameter

Type

Description

config

{ readonly params?: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[]; aliasFor?: string; }

(Optional) Description of the route reference to be created.

**Returns:**

RouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : { [param in TParamKeys]: string; }>