MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / loadApp

Function loadApp

frontend/src/hooks/useMountComponent.ts:36–59  ·  view source on GitHub ↗
(
    component: Component
  )

Source from the content-addressed store, hash-verified

34 };
35
36 const loadApp = <T extends Component>(
37 component: Component
38 ): { component: T; app: App; div: HTMLDivElement; destroyFc: () => void } => {
39 const div = document.createElement("div");
40 document.body.appendChild(div);
41 const app = createApp(component, {
42 ...data,
43 async destroyComponent(delay = 1000) {
44 await sleep(delay);
45 app.unmount();
46 div.remove();
47 }
48 });
49 const mountedComponent = app.mount(div);
50 return {
51 component: mountedComponent as any,
52 app: app,
53 div,
54 destroyFc: () => {
55 app.unmount();
56 div.remove();
57 }
58 };
59 };
60
61 return {
62 mount,

Callers 2

loadIframeModalFunction · 0.85
loadFunction · 0.85

Calls 1

mountMethod · 0.80

Tested by

no test coverage detected