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

Function loadCoreDeps

frontend/src/react/mount.ts:9–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8// Loads the core React + i18n runtime (lazily, cached) used to mount the app.
9export async function loadCoreDeps() {
10 if (cachedDeps) return cachedDeps;
11 const [
12 { createElement, StrictMode },
13 { createRoot },
14 { I18nextProvider },
15 i18nModule,
16 ] = await Promise.all([
17 import("react"),
18 import("react-dom/client"),
19 import("react-i18next"),
20 import("@/react/i18n"),
21 ]);
22 await i18nModule.i18nReady;
23 cachedDeps = {
24 createElement,
25 StrictMode,
26 createRoot,
27 I18nextProvider,
28 i18n: i18nModule.default,
29 };
30 return cachedDeps;
31}
32
33// Wraps a React component in the shared StrictMode + i18n provider tree.
34export function buildTree(

Callers 2

mountReactAppFunction · 0.90
mountReactRouterAppFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected