( current: Fiber, workInProgress: Fiber, oldText: string, newText: string, )
| 660 | } |
| 661 | |
| 662 | function updateHostText( |
| 663 | current: Fiber, |
| 664 | workInProgress: Fiber, |
| 665 | oldText: string, |
| 666 | newText: string, |
| 667 | ) { |
| 668 | if (supportsMutation) { |
| 669 | // If the text differs, mark it as an update. All the work in done in commitWork. |
| 670 | if (oldText !== newText) { |
| 671 | markUpdate(workInProgress); |
| 672 | } |
| 673 | } else if (supportsPersistence) { |
| 674 | if (oldText !== newText) { |
| 675 | // If the text content differs, we'll create a new text instance for it. |
| 676 | const rootContainerInstance = getRootHostContainer(); |
| 677 | const currentHostContext = getHostContext(); |
| 678 | markCloned(workInProgress); |
| 679 | workInProgress.stateNode = createTextInstance( |
| 680 | newText, |
| 681 | rootContainerInstance, |
| 682 | currentHostContext, |
| 683 | workInProgress, |
| 684 | ); |
| 685 | } else { |
| 686 | workInProgress.stateNode = current.stateNode; |
| 687 | } |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | function cutOffTailIfNeeded( |
| 692 | renderState: SuspenseListRenderState, |
no test coverage detected