keycloak-theme-react/src/index.tsx

23 lines
661 B
TypeScript
Raw Normal View History

2022-09-06 17:22:23 +00:00
import { createRoot } from "react-dom/client";
import { StrictMode, lazy, Suspense } from "react";
import { kcContext as kcLoginThemeContext } from "./keycloak-theme/login/kcContext";
2022-09-06 17:22:23 +00:00
const App = lazy(() => import("./App"));
const KcLoginThemeApp = lazy(() => import("./keycloak-theme/login/KcApp"));
2022-09-06 17:22:23 +00:00
createRoot(document.getElementById("root")!).render(
<StrictMode>
2023-02-27 09:13:07 +00:00
<Suspense>
{(()=>{
if( kcLoginThemeContext !== undefined ){
return <KcLoginThemeApp kcContext={kcLoginThemeContext} />;
}
return <App />;
})()}
2023-02-27 09:13:07 +00:00
</Suspense>
</StrictMode>
2022-09-06 17:22:23 +00:00
);