-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
24 lines (21 loc) · 904 Bytes
/
index.tsx
File metadata and controls
24 lines (21 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { clientEnv } from "./clientEnv";
import "./index.css";
import { setRouterBaseRoute } from "./routerInstance.gen";
import { MainLayout } from "./routes";
setRouterBaseRoute(clientEnv.BASE_URL);
// define the startViewTransition function if it does not exist (for Firefox)
if (!document.startViewTransition)
document.startViewTransition = (fn: () => void) => {
const ready = new Promise<undefined>((resolve) => resolve(undefined));
const finished = new Promise<undefined>((resolve) => (fn(), resolve(undefined)));
const updateCallbackDone = new Promise<undefined>((resolve) => resolve(undefined));
const skipTransition = () => {};
return { ready, finished, updateCallbackDone, skipTransition };
};
createRoot(document.getElementById("root")!).render(
<StrictMode>
<MainLayout />
</StrictMode>
);