diff --git a/src/lib/components/KcApp.tsx b/src/lib/components/KcApp.tsx index 084aa5bf..9528b98a 100644 --- a/src/lib/components/KcApp.tsx +++ b/src/lib/components/KcApp.tsx @@ -32,7 +32,7 @@ const KcApp = memo(({ kcContext, i18n: userProvidedI18n, ...props }: { kcContext return userProvidedI18n ?? i18n; })(); - if (i18n === undefined) { + if (i18n === null) { return null; } diff --git a/src/lib/i18n/index.tsx b/src/lib/i18n/index.tsx index 315a8783..b557d725 100644 --- a/src/lib/i18n/index.tsx +++ b/src/lib/i18n/index.tsx @@ -36,7 +36,7 @@ export function __unsafe_useI18n(params: kcContext: KcContextLike; extraMessages: { [languageTag: string]: { [key in ExtraMessageKey]: string } }; doSkip: boolean; -}): I18n | undefined { +}): I18n | null { const { kcContext, extraMessages, doSkip } = params; const [i18n, setI18n] = useState | undefined>(undefined); @@ -53,7 +53,7 @@ export function __unsafe_useI18n(params: const [fallbackMessages, messages] = await Promise.all([ import("./generated_messages/18.0.1/login/en"), - import(`./generated_kcMessages/18.0.1/login/${currentLanguageTag}`), + import(`./generated_messages/18.0.1/login/${currentLanguageTag}`), ]); if (!isMounted) { @@ -98,7 +98,7 @@ export function __unsafe_useI18n(params: }; }, []); - return i18n; + return i18n ?? null; } const useI18n_private = __unsafe_useI18n; @@ -106,7 +106,7 @@ const useI18n_private = __unsafe_useI18n; export function useI18n(params: { kcContext: KcContextLike; extraMessages: { [languageTag: string]: { [key in ExtraMessageKey]: string } }; -}): I18n | undefined { +}): I18n | null { return useI18n_private({ ...params, "doSkip": false, diff --git a/src/lib/index.ts b/src/lib/index.ts index d84c65e5..e51b6bac 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -8,4 +8,6 @@ export * from "./components/KcProps"; export * from "./keycloakJsAdapter"; export * from "./useFormValidationSlice"; -export * from "./tools/assert"; +import KcApp from "./components/KcApp"; + +export default KcApp;