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

Function mountReactRouterApp

frontend/src/react/app/mountApp.ts:10–26  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

8// global overlays (Toaster, AgentWindow, SessionExpiredSurface, Watermark)
9// live in RootLayout, so this one root hosts everything.
10export async function mountReactRouterApp(selector: string) {
11 const container = document.querySelector(selector);
12 if (!container) {
13 throw new Error(`mountReactRouterApp: missing container ${selector}`);
14 }
15 const loader = appRootLoaders["./AppRoot.tsx"] as
16 | (() => Promise<Record<string, unknown>>)
17 | undefined;
18 if (!loader) {
19 throw new Error("mountReactRouterApp: AppRoot loader not registered");
20 }
21 const [deps, mod] = await Promise.all([loadCoreDeps(), loader()]);
22 const AppRoot = mod.AppRoot as ReactComponent;
23 const root = deps.createRoot(container);
24 root.render(buildTree(deps, AppRoot));
25 return root;
26}

Callers 1

main.tsFile · 0.85

Calls 3

loadCoreDepsFunction · 0.90
buildTreeFunction · 0.90
renderMethod · 0.80

Tested by

no test coverage detected