Backstage
    Preparing search index...

    Resolves routes and app-relative pathnames against the app's route tree.

    Available as coreApis.routeResolution.

    interface RouteResolutionApi {
        resolve<TParams extends AnyRouteRefParams>(
            anyRouteRef:
                | RouteRef<TParams>
                | SubRouteRef<TParams>
                | ExternalRouteRef<TParams>,
            options?: { sourcePath?: string },
        ): RouteFunc<TParams> | undefined;
        resolvePath(
            options: { node?: AppNode; pathname: string },
        ): { matches: readonly RouteResolutionMatch[] };
    }
    Index
    • Matches an app-relative pathname against the app's route tree.

      Matches are ordered from outermost to innermost. When a node is supplied, only matches belonging to that node or its app-tree ancestors are returned. Nodes without a route inherit their ancestors' routing scope. An unmatched pathname returns an empty array of matches.

      The pathname excludes the deployment basename. It can differ from the current browser location, allowing adapters to resolve navigation before React renders the destination.

      Parameters

      • options: { node?: AppNode; pathname: string }

      Returns { matches: readonly RouteResolutionMatch[] }