(
returnFiber: Fiber,
current: Fiber | null,
portal: ReactPortal,
lanes: Lanes,
)
| 615 | } |
| 616 | |
| 617 | function updatePortal( |
| 618 | returnFiber: Fiber, |
| 619 | current: Fiber | null, |
| 620 | portal: ReactPortal, |
| 621 | lanes: Lanes, |
| 622 | ): Fiber { |
| 623 | if ( |
| 624 | current === null || |
| 625 | current.tag !== HostPortal || |
| 626 | current.stateNode.containerInfo !== portal.containerInfo || |
| 627 | current.stateNode.implementation !== portal.implementation |
| 628 | ) { |
| 629 | // Insert |
| 630 | const created = createFiberFromPortal(portal, returnFiber.mode, lanes); |
| 631 | created.return = returnFiber; |
| 632 | if (__DEV__) { |
| 633 | created._debugInfo = currentDebugInfo; |
| 634 | } |
| 635 | return created; |
| 636 | } else { |
| 637 | // Update |
| 638 | const existing = useFiber(current, portal.children || []); |
| 639 | existing.return = returnFiber; |
| 640 | if (__DEV__) { |
| 641 | existing._debugInfo = currentDebugInfo; |
| 642 | } |
| 643 | return existing; |
| 644 | } |
| 645 | } |
| 646 | |
| 647 | function updateFragment( |
| 648 | returnFiber: Fiber, |
no test coverage detected