(fiber: Fiber)
| 90 | } |
| 91 | |
| 92 | function pushHostContext(fiber: Fiber): void { |
| 93 | const stateHook: Hook | null = fiber.memoizedState; |
| 94 | if (stateHook !== null) { |
| 95 | // Only provide context if this fiber has been upgraded by a host |
| 96 | // transition. We use the same optimization for regular host context below. |
| 97 | push(hostTransitionProviderCursor, fiber, fiber); |
| 98 | } |
| 99 | |
| 100 | const context: HostContext = requiredContext(contextStackCursor.current); |
| 101 | const nextContext = getChildHostContext(context, fiber.type); |
| 102 | |
| 103 | // Don't push this Fiber's context unless it's unique. |
| 104 | if (context !== nextContext) { |
| 105 | // Track the context and the Fiber that provided it. |
| 106 | // This enables us to pop only Fibers that provide unique contexts. |
| 107 | push(contextFiberStackCursor, fiber, fiber); |
| 108 | push(contextStackCursor, nextContext, fiber); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | function popHostContext(fiber: Fiber): void { |
| 113 | if (contextFiberStackCursor.current === fiber) { |
no test coverage detected