Skip to main content

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[];
}): RouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : {
[param in TParamKeys]: string;
}>;

Parameters

ParameterTypeDescription
config{ readonly params: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[]; }(Optional) Description of the route reference to be created.

Returns:

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