(fiber: Fiber, nextRootInstance: Container)
| 59 | } |
| 60 | |
| 61 | function pushHostContainer(fiber: Fiber, nextRootInstance: Container): void { |
| 62 | // Push current root instance onto the stack; |
| 63 | // This allows us to reset root when portals are popped. |
| 64 | push(rootInstanceStackCursor, nextRootInstance, fiber); |
| 65 | // Track the context and the Fiber that provided it. |
| 66 | // This enables us to pop only Fibers that provide unique contexts. |
| 67 | push(contextFiberStackCursor, fiber, fiber); |
| 68 | |
| 69 | // Finally, we need to push the host context to the stack. |
| 70 | // However, we can't just call getRootHostContext() and push it because |
| 71 | // we'd have a different number of entries on the stack depending on |
| 72 | // whether getRootHostContext() throws somewhere in renderer code or not. |
| 73 | // So we push an empty value first. This lets us safely unwind on errors. |
| 74 | push(contextStackCursor, null, fiber); |
| 75 | const nextRootContext = getRootHostContext(nextRootInstance); |
| 76 | // Now that we know this function doesn't throw, replace it. |
| 77 | pop(contextStackCursor, fiber); |
| 78 | push(contextStackCursor, nextRootContext, fiber); |
| 79 | } |
| 80 | |
| 81 | function popHostContainer(fiber: Fiber) { |
| 82 | pop(contextStackCursor, fiber); |
no test coverage detected