From b465fbb09b661819de5f61910bc98932d8f6b1de Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Thu, 31 Jul 2025 16:38:53 +0200 Subject: [PATCH] chore: fixing types Signed-off-by: benjdlambert --- .../src/convertLegacyAppOptions.tsx | 2 +- packages/frontend-plugin-api/report.api.md | 21 ++++++------------- .../src/app/renderInTestApp.tsx | 2 +- plugins/app/report.api.md | 8 ++----- plugins/app/src/extensions/AppRoot.tsx | 2 +- 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/packages/core-compat-api/src/convertLegacyAppOptions.tsx b/packages/core-compat-api/src/convertLegacyAppOptions.tsx index c98875464c..9da935957a 100644 --- a/packages/core-compat-api/src/convertLegacyAppOptions.tsx +++ b/packages/core-compat-api/src/convertLegacyAppOptions.tsx @@ -139,7 +139,7 @@ export function convertLegacyAppOptions( if (Router) { extensions.push( RouterBlueprint.make({ - params: { Component: componentCompatWrapper(Router) }, + params: { component: componentCompatWrapper(Router) }, }), ); } diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 8ae1960221..b91295630b 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -71,7 +71,6 @@ import { OpenIdConnectApi } from '@backstage/core-plugin-api'; import { PendingOAuthRequest } from '@backstage/core-plugin-api'; import { ProfileInfo } from '@backstage/core-plugin-api'; import { ProfileInfoApi } from '@backstage/core-plugin-api'; -import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api'; import { SessionApi } from '@backstage/core-plugin-api'; @@ -268,12 +267,10 @@ export const AppRootWrapperBlueprint: ExtensionBlueprint<{ kind: 'app-root-wrapper'; name: undefined; params: { - Component: ComponentType>; + component: (props: { children: ReactNode }) => JSX.Element | null; }; output: ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.root.wrapper', {} >; @@ -282,9 +279,7 @@ export const AppRootWrapperBlueprint: ExtensionBlueprint<{ configInput: {}; dataRefs: { component: ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.root.wrapper', {} >; @@ -1724,12 +1719,10 @@ export const RouterBlueprint: ExtensionBlueprint<{ kind: 'app-router-component'; name: undefined; params: { - Component: ComponentType>; + component: (props: { children: ReactNode }) => JSX.Element | null; }; output: ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.router.wrapper', {} >; @@ -1738,9 +1731,7 @@ export const RouterBlueprint: ExtensionBlueprint<{ configInput: {}; dataRefs: { component: ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.router.wrapper', {} >; diff --git a/packages/frontend-test-utils/src/app/renderInTestApp.tsx b/packages/frontend-test-utils/src/app/renderInTestApp.tsx index d4010a92ad..e308cf9741 100644 --- a/packages/frontend-test-utils/src/app/renderInTestApp.tsx +++ b/packages/frontend-test-utils/src/app/renderInTestApp.tsx @@ -160,7 +160,7 @@ export function renderInTestApp( }), RouterBlueprint.make({ params: { - Component: ({ children }) => ( + component: ({ children }) => ( {children} diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index 15001d2961..4eb1ff76fc 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -130,9 +130,7 @@ const appPlugin: FrontendPlugin< inputs: { router: ExtensionInput< ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.router.wrapper', {} >, @@ -168,9 +166,7 @@ const appPlugin: FrontendPlugin< >; wrappers: ExtensionInput< ConfigurableExtensionDataRef< - ComponentType<{ - children?: ReactNode | undefined; - }>, + (props: { children: ReactNode }) => JSX.Element | null, 'app.root.wrapper', {} >, diff --git a/plugins/app/src/extensions/AppRoot.tsx b/plugins/app/src/extensions/AppRoot.tsx index 17e8aa3b1f..9ce2b055dd 100644 --- a/plugins/app/src/extensions/AppRoot.tsx +++ b/plugins/app/src/extensions/AppRoot.tsx @@ -182,7 +182,7 @@ type RouteResolverProxy = { export interface AppRouterProps { children?: ReactNode; SignInPageComponent?: ComponentType; - RouterComponent?: ComponentType>; + RouterComponent?: (props: { children: ReactNode }) => JSX.Element | null; extraElements?: Array; }