(current, workInProgress, renderExpirationTime)
| 18355 | } |
| 18356 | |
| 18357 | function updateContextProvider(current, workInProgress, renderExpirationTime) { |
| 18358 | var providerType = workInProgress.type; |
| 18359 | var context = providerType._context; |
| 18360 | var newProps = workInProgress.pendingProps; |
| 18361 | var oldProps = workInProgress.memoizedProps; |
| 18362 | var newValue = newProps.value; |
| 18363 | |
| 18364 | { |
| 18365 | var providerPropTypes = workInProgress.type.propTypes; |
| 18366 | |
| 18367 | if (providerPropTypes) { |
| 18368 | checkPropTypes_1(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); |
| 18369 | } |
| 18370 | } |
| 18371 | |
| 18372 | pushProvider(workInProgress, newValue); |
| 18373 | |
| 18374 | if (oldProps !== null) { |
| 18375 | var oldValue = oldProps.value; |
| 18376 | var changedBits = calculateChangedBits(context, newValue, oldValue); |
| 18377 | |
| 18378 | if (changedBits === 0) { |
| 18379 | // No change. Bailout early if children are the same. |
| 18380 | if (oldProps.children === newProps.children && !hasContextChanged()) { |
| 18381 | return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); |
| 18382 | } |
| 18383 | } else { |
| 18384 | // The context value changed. Search for matching consumers and schedule |
| 18385 | // them to update. |
| 18386 | propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); |
| 18387 | } |
| 18388 | } |
| 18389 | |
| 18390 | var newChildren = newProps.children; |
| 18391 | reconcileChildren(current, workInProgress, newChildren, renderExpirationTime); |
| 18392 | return workInProgress.child; |
| 18393 | } |
| 18394 | |
| 18395 | var hasWarnedAboutUsingContextAsConsumer = false; |
| 18396 |
no test coverage detected