aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.tsx
blob: 8438b675fd76546d50b3d647dee666f086653f3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { createRoot } from "react-dom/client";
import { StrictMode, lazy, Suspense } from "react";
import { kcContext } from "./KcApp/kcContext";

const App = lazy(() => import("./App"));
const KcApp = lazy(() => import("./KcApp"));

if (kcContext !== undefined) {
    console.log(kcContext);
}

createRoot(document.getElementById("root")!).render(
    <StrictMode>
        <Suspense>{kcContext === undefined ? <App /> : <KcApp kcContext={kcContext} />}</Suspense>
    </StrictMode>,
);