( node: Fiber, context: ReactContext<T>, childContextValues: Array<T>, )
| 109 | } |
| 110 | |
| 111 | function collectNearestContextValues<T>( |
| 112 | node: Fiber, |
| 113 | context: ReactContext<T>, |
| 114 | childContextValues: Array<T>, |
| 115 | ): void { |
| 116 | if (node.tag === ContextProvider && node.type === context) { |
| 117 | const contextValue = node.memoizedProps.value; |
| 118 | childContextValues.push(contextValue); |
| 119 | } else { |
| 120 | let child = node.child; |
| 121 | |
| 122 | if (isFiberSuspenseAndTimedOut(node)) { |
| 123 | child = getSuspenseFallbackChild(node); |
| 124 | } |
| 125 | if (child !== null) { |
| 126 | collectNearestChildContextValues(child, context, childContextValues); |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | function collectNearestChildContextValues<T>( |
| 132 | startingChild: Fiber | null, |
no test coverage detected