(current, workInProgress, renderExpirationTime)
| 9891 | } |
| 9892 | |
| 9893 | function updateClassComponent(current, workInProgress, renderExpirationTime) { |
| 9894 | // Push context providers early to prevent context stack mismatches. |
| 9895 | // During mounting we don't know the child context yet as the instance doesn't exist. |
| 9896 | // We will invalidate the child context in finishClassComponent() right after rendering. |
| 9897 | var hasContext = pushLegacyContextProvider(workInProgress); |
| 9898 | var shouldUpdate = void 0; |
| 9899 | if (current === null) { |
| 9900 | if (workInProgress.stateNode === null) { |
| 9901 | // In the initial pass we might need to construct the instance. |
| 9902 | constructClassInstance(workInProgress, workInProgress.pendingProps); |
| 9903 | mountClassInstance(workInProgress, renderExpirationTime); |
| 9904 | |
| 9905 | shouldUpdate = true; |
| 9906 | } else { |
| 9907 | // In a resume, we'll already have an instance we can reuse. |
| 9908 | shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); |
| 9909 | } |
| 9910 | } else { |
| 9911 | shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime); |
| 9912 | } |
| 9913 | |
| 9914 | // We processed the update queue inside updateClassInstance. It may have |
| 9915 | // included some errors that were dispatched during the commit phase. |
| 9916 | // TODO: Refactor class components so this is less awkward. |
| 9917 | var didCaptureError = false; |
| 9918 | var updateQueue = workInProgress.updateQueue; |
| 9919 | if (updateQueue !== null && updateQueue.capturedValues !== null) { |
| 9920 | shouldUpdate = true; |
| 9921 | didCaptureError = true; |
| 9922 | } |
| 9923 | return finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime); |
| 9924 | } |
| 9925 | |
| 9926 | function finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime) { |
| 9927 | // Refs should update even if shouldComponentUpdate returns false |
no test coverage detected