()
| 7 | |
| 8 | // Loads the core React + i18n runtime (lazily, cached) used to mount the app. |
| 9 | export 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. |
| 34 | export function buildTree( |
no outgoing calls
no test coverage detected