(current, workInProgress, renderExpirationTime)
| 9186 | } |
| 9187 | |
| 9188 | function updateClassComponent(current, workInProgress, renderExpirationTime) { |
| 9189 | // Push context providers early to prevent context stack mismatches. |
| 9190 | // During mounting we don't know the child context yet as the instance doesn't exist. |
| 9191 | // We will invalidate the child context in finishClassComponent() right after rendering. |
| 9192 | var hasContext = pushLegacyContextProvider(workInProgress); |
| 9193 | var shouldUpdate = void 0; |
| 9194 | if (current === null) { |
| 9195 | if (workInProgress.stateNode === null) { |
| 9196 | // In the initial pass we might need to construct the instance. |
| 9197 | constructClassInstance(workInProgress, workInProgress.pendingProps); |
| 9198 | mountClassInstance(workInProgress, renderExpirationTime); |
| 9199 | |
| 9200 | shouldUpdate = true; |
| 9201 | } else { |
| 9202 | // In a resume, we'll already have an instance we can reuse. |
| 9203 | shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); |
| 9204 | } |
| 9205 | } else { |
| 9206 | shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime); |
| 9207 | } |
| 9208 | |
| 9209 | // We processed the update queue inside updateClassInstance. It may have |
| 9210 | // included some errors that were dispatched during the commit phase. |
| 9211 | // TODO: Refactor class components so this is less awkward. |
| 9212 | var didCaptureError = false; |
| 9213 | var updateQueue = workInProgress.updateQueue; |
| 9214 | if (updateQueue !== null && updateQueue.capturedValues !== null) { |
| 9215 | shouldUpdate = true; |
| 9216 | didCaptureError = true; |
| 9217 | } |
| 9218 | return finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime); |
| 9219 | } |
| 9220 | |
| 9221 | function finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime) { |
| 9222 | // Refs should update even if shouldComponentUpdate returns false |
no test coverage detected