MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / initializeApp

Function initializeApp

frontend/packages/core/src/main.tsx:7–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import './index.css'
6import { LocaleProvider } from '@common/contexts/LocaleContext.tsx';
7async function initializeApp() {
8 try {
9 // 初始化行为
10 // await fetchInitialConfig(); // 示例:获取初始配置
11
12 // 异步操作完成后,渲染React消费者
13 ReactDOM.createRoot(document.getElementById('root')!).render(
14 <StrictMode>
15 <LocaleProvider>
16 <App />
17 </LocaleProvider>
18 </StrictMode>,
19 );
20 } catch (error) {
21 console.error('Initialization failed:', error);
22 // 处理初始化失败的情况,比如渲染一个错误界面
23 }
24}
25
26// 执行初始化
27initializeApp();

Callers 1

main.tsxFile · 0.70

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected