MCPcopy Index your code
hub / github.com/react/react / getPublicRootInstance

Function getPublicRootInstance

packages/react-reconciler/src/ReactFiberReconciler.js:473–487  ·  view source on GitHub ↗
(
  container: OpaqueRoot,
)

Source from the content-addressed store, hash-verified

471};
472
473export function getPublicRootInstance(
474 container: OpaqueRoot,
475): component(...props: any) | PublicInstance | null {
476 const containerFiber = container.current;
477 if (!containerFiber.child) {
478 return null;
479 }
480 switch (containerFiber.child.tag) {
481 case HostSingleton:
482 case HostComponent:
483 return getPublicInstance(containerFiber.child.stateNode);
484 default:
485 return containerFiber.child.stateNode;
486 }
487}
488
489export function attemptSynchronousHydration(fiber: Fiber): void {
490 switch (fiber.tag) {

Callers 5

renderFunction · 0.90
renderFunction · 0.90
getInstanceFunction · 0.90

Calls 1

getPublicInstanceFunction · 0.90

Tested by

no test coverage detected