MCPcopy Create free account
hub / github.com/bytebase/bytebase / loadReactApp

Function loadReactApp

frontend/src/react/app/mount.ts:6–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4const reactAppLoaders = import.meta.glob("./ReactApp.tsx");
5
6async function loadReactApp(): Promise<ReactComponent> {
7 const loader = reactAppLoaders["./ReactApp.tsx"] as
8 | (() => Promise<Record<string, unknown>>)
9 | undefined;
10 if (!loader) {
11 throw new Error("mountReactApp: ReactApp loader not registered");
12 }
13 const mod = await loader();
14 return mod.ReactApp as ReactComponent;
15}
16
17export async function mountReactApp(selector: string) {
18 const container = document.querySelector(selector);

Callers 1

mountReactAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected