Skip to main content

ToNewRouteRef

Home > @backstage/core-compat-api > ToNewRouteRef

Converts a legacy route ref type to the new system.

Signature:

export type ToNewRouteRef<T extends LegacyRouteRef | LegacySubRouteRef | LegacyExternalRouteRef> = T extends LegacyRouteRef<infer IParams> ? RouteRef<IParams> : T extends LegacySubRouteRef<infer IParams> ? SubRouteRef<IParams> : T extends LegacyExternalRouteRef<infer IParams> ? ExternalRouteRef<IParams> : never;

References: LegacyRouteRef, LegacySubRouteRef, LegacyExternalRouteRef, RouteRef, SubRouteRef, ExternalRouteRef