(selector: string)
| 8 | // global overlays (Toaster, AgentWindow, SessionExpiredSurface, Watermark) |
| 9 | // live in RootLayout, so this one root hosts everything. |
| 10 | export 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 | } |
no test coverage detected