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

Function updateHostSingleton

packages/react-reconciler/src/ReactFiberBeginWork.js:2046–2066  ·  view source on GitHub ↗
(
  current: Fiber | null,
  workInProgress: Fiber,
  renderLanes: Lanes,
)

Source from the content-addressed store, hash-verified

2044}
2045
2046function updateHostSingleton(
2047 current: Fiber | null,
2048 workInProgress: Fiber,
2049 renderLanes: Lanes,
2050) {
2051 pushHostContext(workInProgress);
2052
2053 if (current === null) {
2054 claimHydratableSingleton(workInProgress);
2055 }
2056
2057 const nextChildren = workInProgress.pendingProps.children;
2058 reconcileChildren(current, workInProgress, nextChildren, renderLanes);
2059 markRef(current, workInProgress);
2060 if (current === null) {
2061 // We mark Singletons with a static flag to more efficiently manage their
2062 // ownership of the singleton host instance when in offscreen trees including Suspense
2063 workInProgress.flags |= LayoutStatic;
2064 }
2065 return workInProgress.child;
2066}
2067
2068function updateHostText(current: null | Fiber, workInProgress: Fiber) {
2069 if (current === null) {

Callers 1

beginWorkFunction · 0.85

Calls 4

pushHostContextFunction · 0.90
claimHydratableSingletonFunction · 0.90
reconcileChildrenFunction · 0.85
markRefFunction · 0.85

Tested by

no test coverage detected