diff --git a/packages/frontend-plugin-api/api-report.md b/packages/frontend-plugin-api/api-report.md index 514ca0d82e..a27875bcf8 100644 --- a/packages/frontend-plugin-api/api-report.md +++ b/packages/frontend-plugin-api/api-report.md @@ -11,6 +11,7 @@ import { ComponentType } from 'react'; import { JsonObject } from '@backstage/types'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; +import { RouteRef } from '@backstage/core-plugin-api'; import { z } from 'zod'; import { ZodSchema } from 'zod'; import { ZodTypeDef } from 'zod'; @@ -33,6 +34,7 @@ export const coreExtensionData: { reactComponent: ExtensionDataRef>; routePath: ExtensionDataRef; apiFactory: ExtensionDataRef; + routeRef: ExtensionDataRef>; }; // @public (undocumented) @@ -138,6 +140,7 @@ export function createPageExtension< at?: string; disabled?: boolean; inputs?: TInputs; + routeRef?: RouteRef; component: (props: { config: TConfig; inputs: { @@ -230,4 +233,7 @@ export type PortableSchema = { parse: (input: unknown) => TOutput; schema: JsonObject; }; + +// @public (undocumented) +export function useRouteRef(routeRef: RouteRef): () => string; ``` diff --git a/packages/frontend-plugin-api/src/routing/useRouteRef.ts b/packages/frontend-plugin-api/src/routing/useRouteRef.ts index fa50522bca..ad1c16ea8e 100644 --- a/packages/frontend-plugin-api/src/routing/useRouteRef.ts +++ b/packages/frontend-plugin-api/src/routing/useRouteRef.ts @@ -20,6 +20,7 @@ import { RoutingContext } from '@backstage/frontend-app-api/src/routing/RoutingC import { useContext, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; +/** @public */ export function useRouteRef(routeRef: RouteRef): () => string { const { pathname } = useLocation(); const resolver = useContext(RoutingContext);