(fiber: Fiber)
| 110 | } |
| 111 | |
| 112 | function popHostContext(fiber: Fiber): void { |
| 113 | if (contextFiberStackCursor.current === fiber) { |
| 114 | // Do not pop unless this Fiber provided the current context. |
| 115 | // pushHostContext() only pushes Fibers that provide unique contexts. |
| 116 | pop(contextStackCursor, fiber); |
| 117 | pop(contextFiberStackCursor, fiber); |
| 118 | } |
| 119 | |
| 120 | if (hostTransitionProviderCursor.current === fiber) { |
| 121 | // Do not pop unless this Fiber provided the current context. This is mostly |
| 122 | // a performance optimization, but conveniently it also prevents a potential |
| 123 | // data race where a host provider is upgraded (i.e. memoizedState becomes |
| 124 | // non-null) during a concurrent event. This is a bit of a flaw in the way |
| 125 | // we upgrade host components, but because we're accounting for it here, it |
| 126 | // should be fine. |
| 127 | pop(hostTransitionProviderCursor, fiber); |
| 128 | |
| 129 | // When popping the transition provider, we reset the context value back |
| 130 | // to `NotPendingTransition`. We can do this because you're not allowed to nest forms. If |
| 131 | // we allowed for multiple nested host transition providers, then we'd |
| 132 | // need to reset this to the parent provider's status. |
| 133 | if (isPrimaryRenderer) { |
| 134 | HostTransitionContext._currentValue = NotPendingTransition; |
| 135 | } else { |
| 136 | HostTransitionContext._currentValue2 = NotPendingTransition; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | export { |
| 142 | getHostContext, |
no test coverage detected