( workInProgress: Fiber, totalChildren: number, )
| 104 | } |
| 105 | |
| 106 | export function pushTreeFork( |
| 107 | workInProgress: Fiber, |
| 108 | totalChildren: number, |
| 109 | ): void { |
| 110 | // This is called right after we reconcile an array (or iterator) of child |
| 111 | // fibers, because that's the only place where we know how many children in |
| 112 | // the whole set without doing extra work later, or storing addtional |
| 113 | // information on the fiber. |
| 114 | // |
| 115 | // That's why this function is separate from pushTreeId — it's called during |
| 116 | // the render phase of the fork parent, not the child, which is where we push |
| 117 | // the other context values. |
| 118 | // |
| 119 | // In the Fizz implementation this is much simpler because the child is |
| 120 | // rendered in the same callstack as the parent. |
| 121 | // |
| 122 | // It might be better to just add a `forks` field to the Fiber type. It would |
| 123 | // make this module simpler. |
| 124 | |
| 125 | warnIfNotHydrating(); |
| 126 | |
| 127 | forkStack[forkStackIndex++] = treeForkCount; |
| 128 | forkStack[forkStackIndex++] = treeForkProvider; |
| 129 | |
| 130 | treeForkProvider = workInProgress; |
| 131 | treeForkCount = totalChildren; |
| 132 | } |
| 133 | |
| 134 | export function pushTreeId( |
| 135 | workInProgress: Fiber, |
no test coverage detected