(workInProgress, type, didChange)
| 11939 | } |
| 11940 | |
| 11941 | function invalidateContextProvider(workInProgress, type, didChange) { |
| 11942 | { |
| 11943 | var instance = workInProgress.stateNode; |
| 11944 | |
| 11945 | if (!instance) { |
| 11946 | throw new Error('Expected to have an instance by this point. ' + 'This error is likely caused by a bug in React. Please file an issue.'); |
| 11947 | } |
| 11948 | |
| 11949 | if (didChange) { |
| 11950 | // Merge parent and own context. |
| 11951 | // Skip this if we're not updating due to sCU. |
| 11952 | // This avoids unnecessarily recomputing memoized values. |
| 11953 | var mergedContext = processChildContext(workInProgress, type, previousContext); |
| 11954 | instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. |
| 11955 | // It is important to unwind the context in the reverse order. |
| 11956 | |
| 11957 | pop(didPerformWorkStackCursor, workInProgress); |
| 11958 | pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. |
| 11959 | |
| 11960 | push(contextStackCursor, mergedContext, workInProgress); |
| 11961 | push(didPerformWorkStackCursor, didChange, workInProgress); |
| 11962 | } else { |
| 11963 | pop(didPerformWorkStackCursor, workInProgress); |
| 11964 | push(didPerformWorkStackCursor, didChange, workInProgress); |
| 11965 | } |
| 11966 | } |
| 11967 | } |
| 11968 | |
| 11969 | function findCurrentUnmaskedContext(fiber) { |
| 11970 | { |
no test coverage detected
searching dependent graphs…