(current, workInProgress, renderExpirationTime)
| 10107 | } |
| 10108 | |
| 10109 | function updateClassComponent(current, workInProgress, renderExpirationTime) { |
| 10110 | // Push context providers early to prevent context stack mismatches. |
| 10111 | // During mounting we don't know the child context yet as the instance doesn't exist. |
| 10112 | // We will invalidate the child context in finishClassComponent() right after rendering. |
| 10113 | var hasContext = pushLegacyContextProvider(workInProgress); |
| 10114 | var shouldUpdate = void 0; |
| 10115 | if (current === null) { |
| 10116 | if (workInProgress.stateNode === null) { |
| 10117 | // In the initial pass we might need to construct the instance. |
| 10118 | constructClassInstance(workInProgress, workInProgress.pendingProps); |
| 10119 | mountClassInstance(workInProgress, renderExpirationTime); |
| 10120 | |
| 10121 | shouldUpdate = true; |
| 10122 | } else { |
| 10123 | // In a resume, we'll already have an instance we can reuse. |
| 10124 | shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); |
| 10125 | } |
| 10126 | } else { |
| 10127 | shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime); |
| 10128 | } |
| 10129 | |
| 10130 | // We processed the update queue inside updateClassInstance. It may have |
| 10131 | // included some errors that were dispatched during the commit phase. |
| 10132 | // TODO: Refactor class components so this is less awkward. |
| 10133 | var didCaptureError = false; |
| 10134 | var updateQueue = workInProgress.updateQueue; |
| 10135 | if (updateQueue !== null && updateQueue.capturedValues !== null) { |
| 10136 | shouldUpdate = true; |
| 10137 | didCaptureError = true; |
| 10138 | } |
| 10139 | return finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime); |
| 10140 | } |
| 10141 | |
| 10142 | function finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime) { |
| 10143 | // Refs should update even if shouldComponentUpdate returns false |
no test coverage detected