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

Function pushDebugInfo

packages/react-reconciler/src/ReactChildFiber.js:85–103  ·  view source on GitHub ↗
(
  debugInfo: null | ReactDebugInfo,
)

Source from the content-addressed store, hash-verified

83let currentDebugInfo: null | ReactDebugInfo = null;
84
85function pushDebugInfo(
86 debugInfo: null | ReactDebugInfo,
87): null | ReactDebugInfo {
88 if (!__DEV__) {
89 return null;
90 }
91 const previousDebugInfo = currentDebugInfo;
92 if (debugInfo == null) {
93 // Leave inplace
94 } else if (previousDebugInfo === null) {
95 currentDebugInfo = debugInfo;
96 } else {
97 // If we have two debugInfo, we need to create a new one. This makes the array no longer
98 // live so we'll miss any future updates if we received more so ideally we should always
99 // do this after both have fully resolved/unsuspended.
100 currentDebugInfo = previousDebugInfo.concat(debugInfo);
101 }
102 return previousDebugInfo;
103}
104
105function getCurrentDebugTask(): null | ConsoleTask {
106 // Get the debug task of the parent Server Component if there is one.

Callers 4

createChildFunction · 0.85
updateSlotFunction · 0.85
updateFromMapFunction · 0.85
reconcileChildFibersImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected