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

Function pop

packages/react-reconciler/src/ReactFiberStack.js:30–53  ·  view source on GitHub ↗
(cursor: StackCursor<T>, fiber: Fiber)

Source from the content-addressed store, hash-verified

28}
29
30function pop<T>(cursor: StackCursor<T>, fiber: Fiber): void {
31 if (index < 0) {
32 if (__DEV__) {
33 console.error('Unexpected pop.');
34 }
35 return;
36 }
37
38 if (__DEV__) {
39 if (fiber !== fiberStack[index]) {
40 console.error('Unexpected Fiber popped.');
41 }
42 }
43
44 cursor.current = valueStack[index];
45
46 valueStack[index] = null;
47
48 if (__DEV__) {
49 fiberStack[index] = null;
50 }
51
52 index--;
53}
54
55function push<T>(cursor: StackCursor<T>, value: T, fiber: Fiber): void {
56 index++;

Callers 14

popRootMarkerInstanceFunction · 0.90
popMarkerInstanceFunction · 0.90
pushHostContainerFunction · 0.90
popHostContainerFunction · 0.90
popHostContextFunction · 0.90
popProviderFunction · 0.90
popContextFunction · 0.90
popTopLevelContextObjectFunction · 0.90
popHiddenContextFunction · 0.90
popRootTransitionFunction · 0.90
popTransitionFunction · 0.90

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected