MCPcopy Create free account
hub / github.com/BetaSu/big-react / getHostParent

Function getHostParent

packages/react-reconciler/src/commitWork.ts:484–502  ·  view source on GitHub ↗
(fiber: FiberNode)

Source from the content-addressed store, hash-verified

482}
483
484function getHostParent(fiber: FiberNode): Container | null {
485 let parent = fiber.return;
486
487 while (parent) {
488 const parentTag = parent.tag;
489 // HostComponent HostRoot
490 if (parentTag === HostComponent) {
491 return parent.stateNode as Container;
492 }
493 if (parentTag === HostRoot) {
494 return (parent.stateNode as FiberRootNode).container;
495 }
496 parent = parent.return;
497 }
498 if (__DEV__) {
499 console.warn('未找到host parent');
500 }
501 return null;
502}
503
504function insertOrAppendPlacementNodeIntoContainer(
505 finishedWork: FiberNode,

Callers 2

commitDeletionFunction · 0.85
commitPlacementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected