(finishedWork: Fiber)
| 589 | } |
| 590 | |
| 591 | export function commitRootCallbacks(finishedWork: Fiber) { |
| 592 | // TODO: I think this is now always non-null by the time it reaches the |
| 593 | // commit phase. Consider removing the type check. |
| 594 | const updateQueue: UpdateQueue<mixed> | null = |
| 595 | (finishedWork.updateQueue: any); |
| 596 | if (updateQueue !== null) { |
| 597 | let instance = null; |
| 598 | if (finishedWork.child !== null) { |
| 599 | switch (finishedWork.child.tag) { |
| 600 | case HostSingleton: |
| 601 | case HostComponent: |
| 602 | instance = getPublicInstance(finishedWork.child.stateNode); |
| 603 | break; |
| 604 | case ClassComponent: |
| 605 | instance = finishedWork.child.stateNode; |
| 606 | break; |
| 607 | } |
| 608 | } |
| 609 | try { |
| 610 | if (__DEV__) { |
| 611 | runWithFiberInDEV(finishedWork, commitCallbacks, updateQueue, instance); |
| 612 | } else { |
| 613 | commitCallbacks(updateQueue, instance); |
| 614 | } |
| 615 | } catch (error) { |
| 616 | captureCommitPhaseError(finishedWork, finishedWork.return, error); |
| 617 | } |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | let didWarnAboutUndefinedSnapshotBeforeUpdate: Set<mixed> | null = null; |
| 622 | if (__DEV__) { |
no test coverage detected