MCPcopy
hub / github.com/react/react / getRendererID

Function getRendererID

packages/react-devtools-shared/src/__tests__/utils.js:331–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329}
330
331export function getRendererID(): number {
332 if (global.agent == null) {
333 throw Error('Agent unavailable.');
334 }
335 const ids = Object.keys(global.agent._rendererInterfaces);
336
337 const id = ids.find(innerID => {
338 const rendererInterface = global.agent._rendererInterfaces[innerID];
339 return rendererInterface.renderer.rendererPackageName === 'react-dom';
340 });
341
342 if (id == null) {
343 throw Error('Could not find renderer.');
344 }
345
346 return parseInt(id, 10);
347}
348
349export function legacyRender(elements, container) {
350 if (container == null) {

Callers

nothing calls this directly

Calls 2

keysMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected