MCPcopy
hub / github.com/facebook/react / init

Function init

packages/react-devtools-shell/src/perf-regression/devtools.js:25–47  ·  view source on GitHub ↗
(
  appSource: string,
  appIframe: HTMLIFrameElement,
  devtoolsContainer: HTMLElement,
  loadDevToolsButton: HTMLButtonElement,
)

Source from the content-addressed store, hash-verified

23}
24
25function init(
26 appSource: string,
27 appIframe: HTMLIFrameElement,
28 devtoolsContainer: HTMLElement,
29 loadDevToolsButton: HTMLButtonElement,
30) {
31 const {contentDocument, contentWindow} = appIframe;
32
33 initializeBackend(contentWindow);
34
35 inject(contentDocument, appSource);
36
37 loadDevToolsButton.addEventListener('click', () => {
38 const DevTools = createDevTools(contentWindow);
39 createRoot(devtoolsContainer).render(
40 <DevTools
41 hookNamesModuleLoaderFunction={hookNamesModuleLoaderFunction}
42 showTabBar={true}
43 />,
44 );
45 activateBackend(contentWindow);
46 });
47}
48
49init(
50 'dist/perf-regression-app.js',

Callers 1

devtools.jsFile · 0.70

Calls 4

createRootFunction · 0.90
activateBackendFunction · 0.85
injectFunction · 0.70
renderMethod · 0.65

Tested by

no test coverage detected