(workInProgress, type, didChange)
| 10978 | } |
| 10979 | |
| 10980 | function invalidateContextProvider(workInProgress, type, didChange) { |
| 10981 | { |
| 10982 | var instance = workInProgress.stateNode; |
| 10983 | |
| 10984 | if (!instance) { |
| 10985 | { |
| 10986 | throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." ); |
| 10987 | } |
| 10988 | } |
| 10989 | |
| 10990 | if (didChange) { |
| 10991 | // Merge parent and own context. |
| 10992 | // Skip this if we're not updating due to sCU. |
| 10993 | // This avoids unnecessarily recomputing memoized values. |
| 10994 | var mergedContext = processChildContext(workInProgress, type, previousContext); |
| 10995 | instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. |
| 10996 | // It is important to unwind the context in the reverse order. |
| 10997 | |
| 10998 | pop(didPerformWorkStackCursor, workInProgress); |
| 10999 | pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. |
| 11000 | |
| 11001 | push(contextStackCursor, mergedContext, workInProgress); |
| 11002 | push(didPerformWorkStackCursor, didChange, workInProgress); |
| 11003 | } else { |
| 11004 | pop(didPerformWorkStackCursor, workInProgress); |
| 11005 | push(didPerformWorkStackCursor, didChange, workInProgress); |
| 11006 | } |
| 11007 | } |
| 11008 | } |
| 11009 | |
| 11010 | function findCurrentUnmaskedContext(fiber) { |
| 11011 | { |
no test coverage detected