diff --git a/src/account/pages/PageProps.ts b/src/account/pages/PageProps.ts index afd32504..15ec16aa 100644 --- a/src/account/pages/PageProps.ts +++ b/src/account/pages/PageProps.ts @@ -1,9 +1,9 @@ -import type { LazyExoticComponent } from "react"; import type { I18n } from "keycloakify/account/i18n"; import type { TemplateProps, ClassKey } from "keycloakify/account/TemplateProps"; +import type { LazyOrNot } from "keycloakify/tools/LazyOrNot"; export type PageProps = { - Template: LazyExoticComponent<(props: TemplateProps) => JSX.Element | null>; + Template: LazyOrNot<(props: TemplateProps) => JSX.Element | null>; kcContext: KcContext; i18n: I18nExtended; doUseDefaultCss: boolean; diff --git a/src/login/pages/PageProps.ts b/src/login/pages/PageProps.ts index 32fbb534..6e513130 100644 --- a/src/login/pages/PageProps.ts +++ b/src/login/pages/PageProps.ts @@ -1,9 +1,9 @@ -import type { LazyExoticComponent } from "react"; import type { I18n } from "keycloakify/login/i18n"; import { type TemplateProps, type ClassKey } from "keycloakify/login/TemplateProps"; +import type { LazyOrNot } from "keycloakify/tools/LazyOrNot"; export type PageProps = { - Template: LazyExoticComponent<(props: TemplateProps) => JSX.Element | null>; + Template: LazyOrNot<(props: TemplateProps) => JSX.Element | null>; kcContext: KcContext; i18n: I18nExtended; doUseDefaultCss: boolean; diff --git a/src/tools/LazyOrNot.ts b/src/tools/LazyOrNot.ts new file mode 100644 index 00000000..64d870d1 --- /dev/null +++ b/src/tools/LazyOrNot.ts @@ -0,0 +1,3 @@ +import type { LazyExoticComponent, ComponentType } from "react"; + +export type LazyOrNot> = LazyExoticComponent | Component;