(finishedRoot, current, finishedWork, currentTime, committedExpirationTime)
| 10586 | } |
| 10587 | |
| 10588 | function commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) { |
| 10589 | switch (finishedWork.tag) { |
| 10590 | case ClassComponent: |
| 10591 | { |
| 10592 | var _instance = finishedWork.stateNode; |
| 10593 | if (finishedWork.effectTag & Update) { |
| 10594 | if (current === null) { |
| 10595 | startPhaseTimer(finishedWork, 'componentDidMount'); |
| 10596 | _instance.props = finishedWork.memoizedProps; |
| 10597 | _instance.state = finishedWork.memoizedState; |
| 10598 | _instance.componentDidMount(); |
| 10599 | stopPhaseTimer(); |
| 10600 | } else { |
| 10601 | var prevProps = current.memoizedProps; |
| 10602 | var prevState = current.memoizedState; |
| 10603 | startPhaseTimer(finishedWork, 'componentDidUpdate'); |
| 10604 | _instance.props = finishedWork.memoizedProps; |
| 10605 | _instance.state = finishedWork.memoizedState; |
| 10606 | _instance.componentDidUpdate(prevProps, prevState); |
| 10607 | stopPhaseTimer(); |
| 10608 | } |
| 10609 | } |
| 10610 | var updateQueue = finishedWork.updateQueue; |
| 10611 | if (updateQueue !== null) { |
| 10612 | commitCallbacks(updateQueue, _instance); |
| 10613 | } |
| 10614 | return; |
| 10615 | } |
| 10616 | case HostRoot: |
| 10617 | { |
| 10618 | var _updateQueue = finishedWork.updateQueue; |
| 10619 | if (_updateQueue !== null) { |
| 10620 | var _instance2 = null; |
| 10621 | if (finishedWork.child !== null) { |
| 10622 | switch (finishedWork.child.tag) { |
| 10623 | case HostComponent: |
| 10624 | _instance2 = getPublicInstance(finishedWork.child.stateNode); |
| 10625 | break; |
| 10626 | case ClassComponent: |
| 10627 | _instance2 = finishedWork.child.stateNode; |
| 10628 | break; |
| 10629 | } |
| 10630 | } |
| 10631 | commitCallbacks(_updateQueue, _instance2); |
| 10632 | } |
| 10633 | return; |
| 10634 | } |
| 10635 | case HostComponent: |
| 10636 | { |
| 10637 | var _instance3 = finishedWork.stateNode; |
| 10638 | |
| 10639 | // Renderers may schedule work to be done after host components are mounted |
| 10640 | // (eg DOM renderer may schedule auto-focus for inputs and form controls). |
| 10641 | // These effects should only be committed when components are first mounted, |
| 10642 | // aka when there is no current/alternate. |
| 10643 | if (current === null && finishedWork.effectTag & Update) { |
| 10644 | var type = finishedWork.type; |
| 10645 | var props = finishedWork.memoizedProps; |
no test coverage detected