react-dom 16.6.3 → 16.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build-info.json +8 -0
  2. package/cjs/react-dom-server.browser.development.js +13 -11
  3. package/cjs/react-dom-server.browser.production.min.js +3 -3
  4. package/cjs/react-dom-server.node.development.js +15 -12
  5. package/cjs/react-dom-server.node.production.min.js +4 -4
  6. package/cjs/react-dom-test-utils.development.js +1 -1
  7. package/cjs/react-dom-test-utils.production.min.js +1 -1
  8. package/cjs/react-dom-unstable-fire.development.js +20093 -0
  9. package/cjs/react-dom-unstable-fire.production.min.js +249 -0
  10. package/cjs/react-dom-unstable-fire.profiling.min.js +261 -0
  11. package/cjs/react-dom-unstable-fizz.browser.development.js +144 -0
  12. package/cjs/react-dom-unstable-fizz.browser.production.min.js +11 -0
  13. package/cjs/react-dom-unstable-fizz.node.development.js +150 -0
  14. package/cjs/react-dom-unstable-fizz.node.production.min.js +11 -0
  15. package/cjs/react-dom-unstable-native-dependencies.development.js +1 -1
  16. package/cjs/react-dom-unstable-native-dependencies.production.min.js +1 -1
  17. package/cjs/react-dom.development.js +503 -145
  18. package/cjs/react-dom.production.min.js +163 -163
  19. package/cjs/react-dom.profiling.min.js +140 -139
  20. package/package.json +58 -37
  21. package/umd/react-dom-server.browser.development.js +13 -11
  22. package/umd/react-dom-server.browser.production.min.js +11 -11
  23. package/umd/react-dom-test-utils.development.js +1 -1
  24. package/umd/react-dom-test-utils.production.min.js +1 -1
  25. package/umd/react-dom-unstable-fire.development.js +20220 -0
  26. package/umd/react-dom-unstable-fire.production.min.js +207 -0
  27. package/umd/react-dom-unstable-fire.profiling.min.js +212 -0
  28. package/umd/react-dom-unstable-fizz.browser.development.js +144 -0
  29. package/umd/react-dom-unstable-fizz.browser.production.min.js +10 -0
  30. package/umd/react-dom-unstable-native-dependencies.development.js +1 -1
  31. package/umd/react-dom-unstable-native-dependencies.production.min.js +1 -1
  32. package/umd/react-dom.development.js +506 -145
  33. package/umd/react-dom.production.min.js +195 -192
  34. package/umd/react-dom.profiling.min.js +178 -176
  35. package/unstable-fizz.browser.js +7 -0
  36. package/unstable-fizz.js +3 -0
  37. package/unstable-fizz.node.js +7 -0
@@ -1,4 +1,4 @@
1
- /** @license React v16.6.1
1
+ /** @license React v16.7.0
2
2
  * react-dom.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -2514,13 +2514,14 @@ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2514
2514
 
2515
2515
  function describeFiber(fiber) {
2516
2516
  switch (fiber.tag) {
2517
- case IndeterminateComponent:
2518
- case LazyComponent:
2519
- case FunctionComponent:
2520
- case ClassComponent:
2521
- case HostComponent:
2522
- case Mode:
2523
- case SuspenseComponent:
2517
+ case HostRoot:
2518
+ case HostPortal:
2519
+ case HostText:
2520
+ case Fragment:
2521
+ case ContextProvider:
2522
+ case ContextConsumer:
2523
+ return '';
2524
+ default:
2524
2525
  var owner = fiber._debugOwner;
2525
2526
  var source = fiber._debugSource;
2526
2527
  var name = getComponentName(fiber.type);
@@ -2529,8 +2530,6 @@ function describeFiber(fiber) {
2529
2530
  ownerName = getComponentName(owner.type);
2530
2531
  }
2531
2532
  return describeComponentFrame(name, source, ownerName);
2532
- default:
2533
- return '';
2534
2533
  }
2535
2534
  }
2536
2535
 
@@ -3139,6 +3138,9 @@ var enableProfilerTimer = true;
3139
3138
  // Trace which interactions trigger each commit.
3140
3139
  var enableSchedulerTracing = true;
3141
3140
 
3141
+ // Only used in www builds.
3142
+ // TODO: true? Here it might just be false.
3143
+
3142
3144
  // Only used in www builds.
3143
3145
 
3144
3146
 
@@ -3153,6 +3155,8 @@ var disableInputAttributeSyncing = false;
3153
3155
  // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
3154
3156
  var enableStableConcurrentModeAPIs = false;
3155
3157
 
3158
+ var warnAboutShorthandPropertyCollision = false;
3159
+
3156
3160
  // TODO: direct imports like some-package/src/* are bad. Fix me.
3157
3161
  var didWarnValueDefaultValue = false;
3158
3162
  var didWarnCheckedDefaultChecked = false;
@@ -6090,6 +6094,58 @@ var setTextContent = function (node, text) {
6090
6094
  node.textContent = text;
6091
6095
  };
6092
6096
 
6097
+ // List derived from Gecko source code:
6098
+ // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
6099
+ var shorthandToLonghand = {
6100
+ animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
6101
+ background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
6102
+ backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
6103
+ border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
6104
+ borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
6105
+ borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
6106
+ borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
6107
+ borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
6108
+ borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
6109
+ borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
6110
+ borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
6111
+ borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
6112
+ borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
6113
+ borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
6114
+ borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
6115
+ borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
6116
+ borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
6117
+ columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
6118
+ columns: ['columnCount', 'columnWidth'],
6119
+ flex: ['flexBasis', 'flexGrow', 'flexShrink'],
6120
+ flexFlow: ['flexDirection', 'flexWrap'],
6121
+ font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
6122
+ fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
6123
+ gap: ['columnGap', 'rowGap'],
6124
+ grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
6125
+ gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
6126
+ gridColumn: ['gridColumnEnd', 'gridColumnStart'],
6127
+ gridColumnGap: ['columnGap'],
6128
+ gridGap: ['columnGap', 'rowGap'],
6129
+ gridRow: ['gridRowEnd', 'gridRowStart'],
6130
+ gridRowGap: ['rowGap'],
6131
+ gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
6132
+ listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
6133
+ margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
6134
+ marker: ['markerEnd', 'markerMid', 'markerStart'],
6135
+ mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
6136
+ maskPosition: ['maskPositionX', 'maskPositionY'],
6137
+ outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
6138
+ overflow: ['overflowX', 'overflowY'],
6139
+ padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
6140
+ placeContent: ['alignContent', 'justifyContent'],
6141
+ placeItems: ['alignItems', 'justifyItems'],
6142
+ placeSelf: ['alignSelf', 'justifySelf'],
6143
+ textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
6144
+ textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
6145
+ transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
6146
+ wordWrap: ['overflowWrap']
6147
+ };
6148
+
6093
6149
  /**
6094
6150
  * CSS properties which accept numbers but are not in units of "px".
6095
6151
  */
@@ -6370,6 +6426,69 @@ function setValueForStyles(node, styles) {
6370
6426
  }
6371
6427
  }
6372
6428
 
6429
+ function isValueEmpty(value) {
6430
+ return value == null || typeof value === 'boolean' || value === '';
6431
+ }
6432
+
6433
+ /**
6434
+ * Given {color: 'red', overflow: 'hidden'} returns {
6435
+ * color: 'color',
6436
+ * overflowX: 'overflow',
6437
+ * overflowY: 'overflow',
6438
+ * }. This can be read as "the overflowY property was set by the overflow
6439
+ * shorthand". That is, the values are the property that each was derived from.
6440
+ */
6441
+ function expandShorthandMap(styles) {
6442
+ var expanded = {};
6443
+ for (var key in styles) {
6444
+ var longhands = shorthandToLonghand[key] || [key];
6445
+ for (var i = 0; i < longhands.length; i++) {
6446
+ expanded[longhands[i]] = key;
6447
+ }
6448
+ }
6449
+ return expanded;
6450
+ }
6451
+
6452
+ /**
6453
+ * When mixing shorthand and longhand property names, we warn during updates if
6454
+ * we expect an incorrect result to occur. In particular, we warn for:
6455
+ *
6456
+ * Updating a shorthand property (longhand gets overwritten):
6457
+ * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
6458
+ * becomes .style.font = 'baz'
6459
+ * Removing a shorthand property (longhand gets lost too):
6460
+ * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
6461
+ * becomes .style.font = ''
6462
+ * Removing a longhand property (should revert to shorthand; doesn't):
6463
+ * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
6464
+ * becomes .style.fontVariant = ''
6465
+ */
6466
+ function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
6467
+ if (!warnAboutShorthandPropertyCollision) {
6468
+ return;
6469
+ }
6470
+
6471
+ if (!nextStyles) {
6472
+ return;
6473
+ }
6474
+
6475
+ var expandedUpdates = expandShorthandMap(styleUpdates);
6476
+ var expandedStyles = expandShorthandMap(nextStyles);
6477
+ var warnedAbout = {};
6478
+ for (var key in expandedUpdates) {
6479
+ var originalKey = expandedUpdates[key];
6480
+ var correctOriginalKey = expandedStyles[key];
6481
+ if (correctOriginalKey && originalKey !== correctOriginalKey) {
6482
+ var warningKey = originalKey + ',' + correctOriginalKey;
6483
+ if (warnedAbout[warningKey]) {
6484
+ continue;
6485
+ }
6486
+ warnedAbout[warningKey] = true;
6487
+ warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
6488
+ }
6489
+ }
6490
+ }
6491
+
6373
6492
  // For HTML, certain tags should omit their close tag. We keep a whitelist for
6374
6493
  // those special-case tags.
6375
6494
 
@@ -7809,6 +7928,9 @@ function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContain
7809
7928
  }
7810
7929
  }
7811
7930
  if (styleUpdates) {
7931
+ {
7932
+ validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
7933
+ }
7812
7934
  (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
7813
7935
  }
7814
7936
  return updatePayload;
@@ -9758,6 +9880,26 @@ function FiberNode(tag, pendingProps, key, mode) {
9758
9880
  this.alternate = null;
9759
9881
 
9760
9882
  if (enableProfilerTimer) {
9883
+ // Note: The following is done to avoid a v8 performance cliff.
9884
+ //
9885
+ // Initializing the fields below to smis and later updating them with
9886
+ // double values will cause Fibers to end up having separate shapes.
9887
+ // This behavior/bug has something to do with Object.preventExtension().
9888
+ // Fortunately this only impacts DEV builds.
9889
+ // Unfortunately it makes React unusably slow for some applications.
9890
+ // To work around this, initialize the fields below with doubles.
9891
+ //
9892
+ // Learn more about this here:
9893
+ // https://github.com/facebook/react/issues/14365
9894
+ // https://bugs.chromium.org/p/v8/issues/detail?id=8538
9895
+ this.actualDuration = Number.NaN;
9896
+ this.actualStartTime = Number.NaN;
9897
+ this.selfBaseDuration = Number.NaN;
9898
+ this.treeBaseDuration = Number.NaN;
9899
+
9900
+ // It's okay to replace the initial doubles with smis after initialization.
9901
+ // This won't trigger the performance cliff mentioned above,
9902
+ // and it simplifies other profiler code (including DevTools).
9761
9903
  this.actualDuration = 0;
9762
9904
  this.actualStartTime = -1;
9763
9905
  this.selfBaseDuration = 0;
@@ -10140,6 +10282,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) {
10140
10282
  latestSuspendedTime: NoWork,
10141
10283
  latestPingedTime: NoWork,
10142
10284
 
10285
+ pingCache: null,
10286
+
10143
10287
  didError: false,
10144
10288
 
10145
10289
  pendingCommitExpirationTime: NoWork,
@@ -10163,6 +10307,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) {
10163
10307
  containerInfo: containerInfo,
10164
10308
  pendingChildren: null,
10165
10309
 
10310
+ pingCache: null,
10311
+
10166
10312
  earliestPendingTime: NoWork,
10167
10313
  latestPendingTime: NoWork,
10168
10314
  earliestSuspendedTime: NoWork,
@@ -10537,6 +10683,10 @@ function markCommittedPriorityLevels(root, earliestRemainingTime) {
10537
10683
  return;
10538
10684
  }
10539
10685
 
10686
+ if (earliestRemainingTime < root.latestPingedTime) {
10687
+ root.latestPingedTime = NoWork;
10688
+ }
10689
+
10540
10690
  // Let's see if the previous latest known pending level was just flushed.
10541
10691
  var latestPendingTime = root.latestPendingTime;
10542
10692
  if (latestPendingTime !== NoWork) {
@@ -10662,10 +10812,8 @@ function markPingedPriorityLevel(root, pingedTime) {
10662
10812
  }
10663
10813
 
10664
10814
  function clearPing(root, completedTime) {
10665
- // TODO: Track whether the root was pinged during the render phase. If so,
10666
- // we need to make sure we don't lose track of it.
10667
10815
  var latestPingedTime = root.latestPingedTime;
10668
- if (latestPingedTime !== NoWork && latestPingedTime >= completedTime) {
10816
+ if (latestPingedTime >= completedTime) {
10669
10817
  root.latestPingedTime = NoWork;
10670
10818
  }
10671
10819
  }
@@ -11616,7 +11764,7 @@ function cloneHook(hook) {
11616
11764
  return {
11617
11765
  memoizedState: hook.memoizedState,
11618
11766
 
11619
- baseState: hook.memoizedState,
11767
+ baseState: hook.baseState,
11620
11768
  queue: hook.queue,
11621
11769
  baseUpdate: hook.baseUpdate,
11622
11770
 
@@ -11861,10 +12009,6 @@ function useRef(initialValue) {
11861
12009
  return ref;
11862
12010
  }
11863
12011
 
11864
- function useMutationEffect(create, inputs) {
11865
- useEffectImpl(Snapshot | Update, UnmountSnapshot | MountMutation, create, inputs);
11866
- }
11867
-
11868
12012
  function useLayoutEffect(create, inputs) {
11869
12013
  useEffectImpl(Update, UnmountMutation | MountLayout, create, inputs);
11870
12014
  }
@@ -11899,7 +12043,7 @@ function useImperativeMethods(ref, create, inputs) {
11899
12043
  // TODO: I've implemented this on top of useEffect because it's almost the
11900
12044
  // same thing, and it would require an equal amount of code. It doesn't seem
11901
12045
  // like a common enough use case to justify the additional size.
11902
- useEffectImpl(Update, UnmountMutation | MountLayout, function () {
12046
+ useLayoutEffect(function () {
11903
12047
  if (typeof ref === 'function') {
11904
12048
  var refCallback = ref;
11905
12049
  var _inst = create();
@@ -14061,12 +14205,14 @@ var didWarnAboutBadClass = void 0;
14061
14205
  var didWarnAboutContextTypeOnFunctionComponent = void 0;
14062
14206
  var didWarnAboutGetDerivedStateOnFunctionComponent = void 0;
14063
14207
  var didWarnAboutFunctionRefs = void 0;
14208
+ var didWarnAboutReassigningProps = void 0;
14064
14209
 
14065
14210
  {
14066
14211
  didWarnAboutBadClass = {};
14067
14212
  didWarnAboutContextTypeOnFunctionComponent = {};
14068
14213
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
14069
14214
  didWarnAboutFunctionRefs = {};
14215
+ didWarnAboutReassigningProps = false;
14070
14216
  }
14071
14217
 
14072
14218
  function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
@@ -14105,6 +14251,18 @@ function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildre
14105
14251
  }
14106
14252
 
14107
14253
  function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14254
+ {
14255
+ if (workInProgress.type !== workInProgress.elementType) {
14256
+ // Lazy component props can't be validated in createElement
14257
+ // because they're only guaranteed to be resolved here.
14258
+ var innerPropTypes = Component.propTypes;
14259
+ if (innerPropTypes) {
14260
+ checkPropTypes(innerPropTypes, nextProps, // Resolved props
14261
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14262
+ }
14263
+ }
14264
+ }
14265
+
14108
14266
  var render = Component.render;
14109
14267
  var ref = workInProgress.ref;
14110
14268
 
@@ -14129,20 +14287,44 @@ function updateForwardRef(current$$1, workInProgress, Component, nextProps, rend
14129
14287
  function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
14130
14288
  if (current$$1 === null) {
14131
14289
  var type = Component.type;
14132
- if (isSimpleFunctionComponent(type) && Component.compare === null) {
14290
+ if (isSimpleFunctionComponent(type) && Component.compare === null &&
14291
+ // SimpleMemoComponent codepath doesn't resolve outer props either.
14292
+ Component.defaultProps === undefined) {
14133
14293
  // If this is a plain function component without default props,
14134
14294
  // and with only the default shallow comparison, we upgrade it
14135
14295
  // to a SimpleMemoComponent to allow fast path updates.
14136
14296
  workInProgress.tag = SimpleMemoComponent;
14137
14297
  workInProgress.type = type;
14298
+ {
14299
+ validateFunctionComponentInDev(workInProgress, type);
14300
+ }
14138
14301
  return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime);
14139
14302
  }
14303
+ {
14304
+ var innerPropTypes = type.propTypes;
14305
+ if (innerPropTypes) {
14306
+ // Inner memo component props aren't currently validated in createElement.
14307
+ // We could move it there, but we'd still need this for lazy code path.
14308
+ checkPropTypes(innerPropTypes, nextProps, // Resolved props
14309
+ 'prop', getComponentName(type), getCurrentFiberStackInDev);
14310
+ }
14311
+ }
14140
14312
  var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
14141
14313
  child.ref = workInProgress.ref;
14142
14314
  child.return = workInProgress;
14143
14315
  workInProgress.child = child;
14144
14316
  return child;
14145
14317
  }
14318
+ {
14319
+ var _type = Component.type;
14320
+ var _innerPropTypes = _type.propTypes;
14321
+ if (_innerPropTypes) {
14322
+ // Inner memo component props aren't currently validated in createElement.
14323
+ // We could move it there, but we'd still need this for lazy code path.
14324
+ checkPropTypes(_innerPropTypes, nextProps, // Resolved props
14325
+ 'prop', getComponentName(_type), getCurrentFiberStackInDev);
14326
+ }
14327
+ }
14146
14328
  var currentChild = current$$1.child; // This is always exactly one child
14147
14329
  if (updateExpirationTime < renderExpirationTime) {
14148
14330
  // This will be the props with resolved defaultProps,
@@ -14165,6 +14347,25 @@ function updateMemoComponent(current$$1, workInProgress, Component, nextProps, u
14165
14347
  }
14166
14348
 
14167
14349
  function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
14350
+ {
14351
+ if (workInProgress.type !== workInProgress.elementType) {
14352
+ // Lazy component props can't be validated in createElement
14353
+ // because they're only guaranteed to be resolved here.
14354
+ var outerMemoType = workInProgress.elementType;
14355
+ if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
14356
+ // We warn when you define propTypes on lazy()
14357
+ // so let's just skip over it to find memo() outer wrapper.
14358
+ // Inner props for memo are validated later.
14359
+ outerMemoType = refineResolvedLazyComponent(outerMemoType);
14360
+ }
14361
+ var outerPropTypes = outerMemoType && outerMemoType.propTypes;
14362
+ if (outerPropTypes) {
14363
+ checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
14364
+ 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
14365
+ }
14366
+ // Inner propTypes will be validated in the function component path.
14367
+ }
14368
+ }
14168
14369
  if (current$$1 !== null && updateExpirationTime < renderExpirationTime) {
14169
14370
  var prevProps = current$$1.memoizedProps;
14170
14371
  if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
@@ -14205,6 +14406,18 @@ function markRef(current$$1, workInProgress) {
14205
14406
  }
14206
14407
 
14207
14408
  function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14409
+ {
14410
+ if (workInProgress.type !== workInProgress.elementType) {
14411
+ // Lazy component props can't be validated in createElement
14412
+ // because they're only guaranteed to be resolved here.
14413
+ var innerPropTypes = Component.propTypes;
14414
+ if (innerPropTypes) {
14415
+ checkPropTypes(innerPropTypes, nextProps, // Resolved props
14416
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14417
+ }
14418
+ }
14419
+ }
14420
+
14208
14421
  var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
14209
14422
  var context = getMaskedContext(workInProgress, unmaskedContext);
14210
14423
 
@@ -14226,6 +14439,18 @@ function updateFunctionComponent(current$$1, workInProgress, Component, nextProp
14226
14439
  }
14227
14440
 
14228
14441
  function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14442
+ {
14443
+ if (workInProgress.type !== workInProgress.elementType) {
14444
+ // Lazy component props can't be validated in createElement
14445
+ // because they're only guaranteed to be resolved here.
14446
+ var innerPropTypes = Component.propTypes;
14447
+ if (innerPropTypes) {
14448
+ checkPropTypes(innerPropTypes, nextProps, // Resolved props
14449
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14450
+ }
14451
+ }
14452
+ }
14453
+
14229
14454
  // Push context providers early to prevent context stack mismatches.
14230
14455
  // During mounting we don't know the child context yet as the instance doesn't exist.
14231
14456
  // We will invalidate the child context in finishClassComponent() right after rendering.
@@ -14261,7 +14486,15 @@ function updateClassComponent(current$$1, workInProgress, Component, nextProps,
14261
14486
  } else {
14262
14487
  shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
14263
14488
  }
14264
- return finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
14489
+ var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
14490
+ {
14491
+ var inst = workInProgress.stateNode;
14492
+ if (inst.props !== nextProps) {
14493
+ !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
14494
+ didWarnAboutReassigningProps = true;
14495
+ }
14496
+ }
14497
+ return nextUnitOfWork;
14265
14498
  }
14266
14499
 
14267
14500
  function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
@@ -14474,16 +14707,31 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat
14474
14707
  }
14475
14708
  case MemoComponent:
14476
14709
  {
14710
+ {
14711
+ if (workInProgress.type !== workInProgress.elementType) {
14712
+ var outerPropTypes = Component.propTypes;
14713
+ if (outerPropTypes) {
14714
+ checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
14715
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14716
+ }
14717
+ }
14718
+ }
14477
14719
  child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
14478
14720
  updateExpirationTime, renderExpirationTime);
14479
14721
  break;
14480
14722
  }
14481
14723
  default:
14482
14724
  {
14725
+ var hint = '';
14726
+ {
14727
+ if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
14728
+ hint = ' Did you wrap a component in React.lazy() more than once?';
14729
+ }
14730
+ }
14483
14731
  // This message intentionally doesn't mention ForwardRef or MemoComponent
14484
14732
  // because the fact that it's a separate type of work is an
14485
14733
  // implementation detail.
14486
- invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Promise elements must resolve to a class or function.', Component);
14734
+ invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Lazy element type must resolve to a class or function.%s', Component, hint);
14487
14735
  }
14488
14736
  }
14489
14737
  return child;
@@ -14597,48 +14845,52 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render
14597
14845
  // Proceed under the assumption that this is a function component
14598
14846
  workInProgress.tag = FunctionComponent;
14599
14847
  value = finishHooks(Component, props, value, context);
14848
+ reconcileChildren(null, workInProgress, value, renderExpirationTime);
14600
14849
  {
14601
- if (Component) {
14602
- !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
14603
- }
14604
- if (workInProgress.ref !== null) {
14605
- var info = '';
14606
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
14607
- if (ownerName) {
14608
- info += '\n\nCheck the render method of `' + ownerName + '`.';
14609
- }
14850
+ validateFunctionComponentInDev(workInProgress, Component);
14851
+ }
14852
+ return workInProgress.child;
14853
+ }
14854
+ }
14610
14855
 
14611
- var warningKey = ownerName || workInProgress._debugID || '';
14612
- var debugSource = workInProgress._debugSource;
14613
- if (debugSource) {
14614
- warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
14615
- }
14616
- if (!didWarnAboutFunctionRefs[warningKey]) {
14617
- didWarnAboutFunctionRefs[warningKey] = true;
14618
- warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s', info);
14619
- }
14620
- }
14856
+ function validateFunctionComponentInDev(workInProgress, Component) {
14857
+ if (Component) {
14858
+ !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
14859
+ }
14860
+ if (workInProgress.ref !== null) {
14861
+ var info = '';
14862
+ var ownerName = getCurrentFiberOwnerNameInDevOrNull();
14863
+ if (ownerName) {
14864
+ info += '\n\nCheck the render method of `' + ownerName + '`.';
14865
+ }
14621
14866
 
14622
- if (typeof Component.getDerivedStateFromProps === 'function') {
14623
- var _componentName = getComponentName(Component) || 'Unknown';
14867
+ var warningKey = ownerName || workInProgress._debugID || '';
14868
+ var debugSource = workInProgress._debugSource;
14869
+ if (debugSource) {
14870
+ warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
14871
+ }
14872
+ if (!didWarnAboutFunctionRefs[warningKey]) {
14873
+ didWarnAboutFunctionRefs[warningKey] = true;
14874
+ warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s', info);
14875
+ }
14876
+ }
14624
14877
 
14625
- if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) {
14626
- warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName);
14627
- didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true;
14628
- }
14629
- }
14878
+ if (typeof Component.getDerivedStateFromProps === 'function') {
14879
+ var componentName = getComponentName(Component) || 'Unknown';
14630
14880
 
14631
- if (typeof Component.contextType === 'object' && Component.contextType !== null) {
14632
- var _componentName2 = getComponentName(Component) || 'Unknown';
14881
+ if (!didWarnAboutGetDerivedStateOnFunctionComponent[componentName]) {
14882
+ warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', componentName);
14883
+ didWarnAboutGetDerivedStateOnFunctionComponent[componentName] = true;
14884
+ }
14885
+ }
14633
14886
 
14634
- if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) {
14635
- warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName2);
14636
- didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true;
14637
- }
14638
- }
14887
+ if (typeof Component.contextType === 'object' && Component.contextType !== null) {
14888
+ var _componentName = getComponentName(Component) || 'Unknown';
14889
+
14890
+ if (!didWarnAboutContextTypeOnFunctionComponent[_componentName]) {
14891
+ warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName);
14892
+ didWarnAboutContextTypeOnFunctionComponent[_componentName] = true;
14639
14893
  }
14640
- reconcileChildren(null, workInProgress, value, renderExpirationTime);
14641
- return workInProgress.child;
14642
14894
  }
14643
14895
  }
14644
14896
 
@@ -14840,6 +15092,7 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
14840
15092
  next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
14841
15093
  }
14842
15094
  }
15095
+ workInProgress.stateNode = current$$1.stateNode;
14843
15096
  }
14844
15097
 
14845
15098
  workInProgress.memoizedState = nextState;
@@ -15110,10 +15363,21 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
15110
15363
  return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
15111
15364
  case MemoComponent:
15112
15365
  {
15113
- var _type = workInProgress.type;
15366
+ var _type2 = workInProgress.type;
15114
15367
  var _unresolvedProps3 = workInProgress.pendingProps;
15115
- var _resolvedProps3 = resolveDefaultProps(_type.type, _unresolvedProps3);
15116
- return updateMemoComponent(current$$1, workInProgress, _type, _resolvedProps3, updateExpirationTime, renderExpirationTime);
15368
+ // Resolve outer props first, then resolve inner props.
15369
+ var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
15370
+ {
15371
+ if (workInProgress.type !== workInProgress.elementType) {
15372
+ var outerPropTypes = _type2.propTypes;
15373
+ if (outerPropTypes) {
15374
+ checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
15375
+ 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
15376
+ }
15377
+ }
15378
+ }
15379
+ _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
15380
+ return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
15117
15381
  }
15118
15382
  case SimpleMemoComponent:
15119
15383
  {
@@ -15672,7 +15936,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
15672
15936
  return null;
15673
15937
  }
15674
15938
 
15675
- function shouldCaptureSuspense(current, workInProgress) {
15939
+ function shouldCaptureSuspense(workInProgress) {
15676
15940
  // In order to capture, the Suspense component must have a fallback prop.
15677
15941
  if (workInProgress.memoizedProps.fallback === undefined) {
15678
15942
  return false;
@@ -15755,6 +16019,8 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
15755
16019
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
15756
16020
  }
15757
16021
 
16022
+ var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
16023
+
15758
16024
  function logError(boundary, errorInfo) {
15759
16025
  var source = errorInfo.source;
15760
16026
  var stack = errorInfo.stack;
@@ -15859,9 +16125,9 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
15859
16125
  // but instead we rely on them being set during last render.
15860
16126
  // TODO: revisit this when we implement resuming.
15861
16127
  {
15862
- if (finishedWork.type === finishedWork.elementType) {
15863
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
15864
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
16128
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16129
+ !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
16130
+ !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
15865
16131
  }
15866
16132
  }
15867
16133
  var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
@@ -15917,7 +16183,7 @@ function commitHookEffectList(unmountTag, mountTag, finishedWork) {
15917
16183
  if (typeof _destroy !== 'function') {
15918
16184
  {
15919
16185
  if (_destroy !== null && _destroy !== undefined) {
15920
- warningWithoutStack$1(false, 'useEffect function must return a cleanup function or ' + 'nothing.%s%s', typeof _destroy.then === 'function' ? ' Promises and useEffect(async () => ...) are not ' + 'supported, but you can call an async function inside an ' + 'effect.' : '', getStackByFiberInDevAndProd(finishedWork));
16186
+ warningWithoutStack$1(false, 'useEffect function must return a cleanup function or ' + 'nothing.%s%s', typeof _destroy.then === 'function' ? '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, you may write an async function separately ' + 'and then call it from inside the effect:\n\n' + 'async function fetchComment(commentId) {\n' + ' // You can await here\n' + '}\n\n' + 'useEffect(() => {\n' + ' fetchComment(commentId);\n' + '}, [commentId]);\n\n' + 'In the future, React will provide a more idiomatic solution for data fetching ' + "that doesn't involve writing effects manually." : '', getStackByFiberInDevAndProd(finishedWork));
15921
16187
  }
15922
16188
  }
15923
16189
  _destroy = null;
@@ -15953,9 +16219,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
15953
16219
  // but instead we rely on them being set during last render.
15954
16220
  // TODO: revisit this when we implement resuming.
15955
16221
  {
15956
- if (finishedWork.type === finishedWork.elementType) {
15957
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
15958
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
16222
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16223
+ !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
16224
+ !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
15959
16225
  }
15960
16226
  }
15961
16227
  instance.componentDidMount();
@@ -15968,9 +16234,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
15968
16234
  // but instead we rely on them being set during last render.
15969
16235
  // TODO: revisit this when we implement resuming.
15970
16236
  {
15971
- if (finishedWork.type === finishedWork.elementType) {
15972
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
15973
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
16237
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16238
+ !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
16239
+ !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
15974
16240
  }
15975
16241
  }
15976
16242
  instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
@@ -15980,9 +16246,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
15980
16246
  var updateQueue = finishedWork.updateQueue;
15981
16247
  if (updateQueue !== null) {
15982
16248
  {
15983
- if (finishedWork.type === finishedWork.elementType) {
15984
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
15985
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0;
16249
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16250
+ !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
16251
+ !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
15986
16252
  }
15987
16253
  }
15988
16254
  // We could update instance props and state here,
@@ -16241,9 +16507,14 @@ function detachFiber(current$$1) {
16241
16507
  // itself will be GC:ed when the parent updates the next time.
16242
16508
  current$$1.return = null;
16243
16509
  current$$1.child = null;
16244
- if (current$$1.alternate) {
16245
- current$$1.alternate.child = null;
16246
- current$$1.alternate.return = null;
16510
+ current$$1.memoizedState = null;
16511
+ current$$1.updateQueue = null;
16512
+ var alternate = current$$1.alternate;
16513
+ if (alternate !== null) {
16514
+ alternate.return = null;
16515
+ alternate.child = null;
16516
+ alternate.memoizedState = null;
16517
+ alternate.updateQueue = null;
16247
16518
  }
16248
16519
  }
16249
16520
 
@@ -16532,6 +16803,8 @@ function commitWork(current$$1, finishedWork) {
16532
16803
  case MemoComponent:
16533
16804
  case SimpleMemoComponent:
16534
16805
  {
16806
+ // Note: We currently never use MountMutation, but useLayout uses
16807
+ // UnmountMutation.
16535
16808
  commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
16536
16809
  return;
16537
16810
  }
@@ -16547,6 +16820,8 @@ function commitWork(current$$1, finishedWork) {
16547
16820
  case MemoComponent:
16548
16821
  case SimpleMemoComponent:
16549
16822
  {
16823
+ // Note: We currently never use MountMutation, but useLayout uses
16824
+ // UnmountMutation.
16550
16825
  commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
16551
16826
  return;
16552
16827
  }
@@ -16616,6 +16891,30 @@ function commitWork(current$$1, finishedWork) {
16616
16891
  if (primaryChildParent !== null) {
16617
16892
  hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
16618
16893
  }
16894
+
16895
+ // If this boundary just timed out, then it will have a set of thenables.
16896
+ // For each thenable, attach a listener so that when it resolves, React
16897
+ // attempts to re-render the boundary in the primary (pre-timeout) state.
16898
+ var thenables = finishedWork.updateQueue;
16899
+ if (thenables !== null) {
16900
+ finishedWork.updateQueue = null;
16901
+ var retryCache = finishedWork.stateNode;
16902
+ if (retryCache === null) {
16903
+ retryCache = finishedWork.stateNode = new PossiblyWeakSet();
16904
+ }
16905
+ thenables.forEach(function (thenable) {
16906
+ // Memoize using the boundary fiber to prevent redundant listeners.
16907
+ var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
16908
+ if (enableSchedulerTracing) {
16909
+ retry = tracing.unstable_wrap(retry);
16910
+ }
16911
+ if (!retryCache.has(thenable)) {
16912
+ retryCache.add(thenable);
16913
+ thenable.then(retry, retry);
16914
+ }
16915
+ });
16916
+ }
16917
+
16619
16918
  return;
16620
16919
  }
16621
16920
  case IncompleteClassComponent:
@@ -16636,6 +16935,8 @@ function commitResetTextContent(current$$1) {
16636
16935
  resetTextContent(current$$1.stateNode);
16637
16936
  }
16638
16937
 
16938
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
16939
+
16639
16940
  function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
16640
16941
  var update = createUpdate(expirationTime);
16641
16942
  // Unmount the root by rendering null.
@@ -16739,19 +17040,16 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16739
17040
  // Schedule the nearest Suspense to re-render the timed out view.
16740
17041
  _workInProgress = returnFiber;
16741
17042
  do {
16742
- if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress.alternate, _workInProgress)) {
17043
+ if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) {
16743
17044
  // Found the nearest boundary.
16744
17045
 
16745
- // If the boundary is not in concurrent mode, we should not suspend, and
16746
- // likewise, when the promise resolves, we should ping synchronously.
16747
- var pingTime = (_workInProgress.mode & ConcurrentMode) === NoEffect ? Sync : renderExpirationTime;
16748
-
16749
- // Attach a listener to the promise to "ping" the root and retry.
16750
- var onResolveOrReject = retrySuspendedRoot.bind(null, root, _workInProgress, sourceFiber, pingTime);
16751
- if (enableSchedulerTracing) {
16752
- onResolveOrReject = tracing.unstable_wrap(onResolveOrReject);
17046
+ // Stash the promise on the boundary fiber. If the boundary times out, we'll
17047
+ var thenables = _workInProgress.updateQueue;
17048
+ if (thenables === null) {
17049
+ _workInProgress.updateQueue = new Set([thenable]);
17050
+ } else {
17051
+ thenables.add(thenable);
16753
17052
  }
16754
- thenable.then(onResolveOrReject, onResolveOrReject);
16755
17053
 
16756
17054
  // If the boundary is outside of concurrent mode, we should *not*
16757
17055
  // suspend the commit. Pretend as if the suspended component rendered
@@ -16770,18 +17068,25 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16770
17068
  sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
16771
17069
 
16772
17070
  if (sourceFiber.tag === ClassComponent) {
16773
- var _current = sourceFiber.alternate;
16774
- if (_current === null) {
17071
+ var currentSourceFiber = sourceFiber.alternate;
17072
+ if (currentSourceFiber === null) {
16775
17073
  // This is a new mount. Change the tag so it's not mistaken for a
16776
17074
  // completed class component. For example, we should not call
16777
17075
  // componentWillUnmount if it is deleted.
16778
17076
  sourceFiber.tag = IncompleteClassComponent;
17077
+ } else {
17078
+ // When we try rendering again, we should not reuse the current fiber,
17079
+ // since it's known to be in an inconsistent state. Use a force updte to
17080
+ // prevent a bail out.
17081
+ var update = createUpdate(Sync);
17082
+ update.tag = ForceUpdate;
17083
+ enqueueUpdate(sourceFiber, update);
16779
17084
  }
16780
17085
  }
16781
17086
 
16782
- // The source fiber did not complete. Mark it with the current
16783
- // render priority to indicate that it still has pending work.
16784
- sourceFiber.expirationTime = renderExpirationTime;
17087
+ // The source fiber did not complete. Mark it with Sync priority to
17088
+ // indicate that it still has pending work.
17089
+ sourceFiber.expirationTime = Sync;
16785
17090
 
16786
17091
  // Exit without suspending.
16787
17092
  return;
@@ -16790,6 +17095,32 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16790
17095
  // Confirmed that the boundary is in a concurrent mode tree. Continue
16791
17096
  // with the normal suspend path.
16792
17097
 
17098
+ // Attach a listener to the promise to "ping" the root and retry. But
17099
+ // only if one does not already exist for the current render expiration
17100
+ // time (which acts like a "thread ID" here).
17101
+ var pingCache = root.pingCache;
17102
+ var threadIDs = void 0;
17103
+ if (pingCache === null) {
17104
+ pingCache = root.pingCache = new PossiblyWeakMap();
17105
+ threadIDs = new Set();
17106
+ pingCache.set(thenable, threadIDs);
17107
+ } else {
17108
+ threadIDs = pingCache.get(thenable);
17109
+ if (threadIDs === undefined) {
17110
+ threadIDs = new Set();
17111
+ pingCache.set(thenable, threadIDs);
17112
+ }
17113
+ }
17114
+ if (!threadIDs.has(renderExpirationTime)) {
17115
+ // Memoize using the thread ID to prevent redundant listeners.
17116
+ threadIDs.add(renderExpirationTime);
17117
+ var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
17118
+ if (enableSchedulerTracing) {
17119
+ ping = tracing.unstable_wrap(ping);
17120
+ }
17121
+ thenable.then(ping, ping);
17122
+ }
17123
+
16793
17124
  var absoluteTimeoutMs = void 0;
16794
17125
  if (earliestTimeoutMs === -1) {
16795
17126
  // If no explicit threshold is given, default to an abitrarily large
@@ -16846,8 +17177,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16846
17177
  var _errorInfo = value;
16847
17178
  workInProgress.effectTag |= ShouldCapture;
16848
17179
  workInProgress.expirationTime = renderExpirationTime;
16849
- var update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
16850
- enqueueCapturedUpdate(workInProgress, update);
17180
+ var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
17181
+ enqueueCapturedUpdate(workInProgress, _update);
16851
17182
  return;
16852
17183
  }
16853
17184
  case ClassComponent:
@@ -16859,8 +17190,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16859
17190
  workInProgress.effectTag |= ShouldCapture;
16860
17191
  workInProgress.expirationTime = renderExpirationTime;
16861
17192
  // Schedule the error boundary to re-render using updated state
16862
- var _update = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
16863
- enqueueCapturedUpdate(workInProgress, _update);
17193
+ var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
17194
+ enqueueCapturedUpdate(workInProgress, _update2);
16864
17195
  return;
16865
17196
  }
16866
17197
  break;
@@ -16961,7 +17292,6 @@ var Dispatcher = {
16961
17292
  useImperativeMethods: useImperativeMethods,
16962
17293
  useLayoutEffect: useLayoutEffect,
16963
17294
  useMemo: useMemo,
16964
- useMutationEffect: useMutationEffect,
16965
17295
  useReducer: useReducer,
16966
17296
  useRef: useRef,
16967
17297
  useState: useState
@@ -18236,56 +18566,54 @@ function renderDidError() {
18236
18566
  nextRenderDidError = true;
18237
18567
  }
18238
18568
 
18239
- function retrySuspendedRoot(root, boundaryFiber, sourceFiber, suspendedTime) {
18240
- var retryTime = void 0;
18569
+ function pingSuspendedRoot(root, thenable, pingTime) {
18570
+ // A promise that previously suspended React from committing has resolved.
18571
+ // If React is still suspended, try again at the previous level (pingTime).
18241
18572
 
18242
- if (isPriorityLevelSuspended(root, suspendedTime)) {
18243
- // Ping at the original level
18244
- retryTime = suspendedTime;
18245
-
18246
- markPingedPriorityLevel(root, retryTime);
18247
- } else {
18248
- // Suspense already timed out. Compute a new expiration time
18249
- var currentTime = requestCurrentTime();
18250
- retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
18251
- markPendingPriorityLevel(root, retryTime);
18573
+ var pingCache = root.pingCache;
18574
+ if (pingCache !== null) {
18575
+ // The thenable resolved, so we no longer need to memoize, because it will
18576
+ // never be thrown again.
18577
+ pingCache.delete(thenable);
18252
18578
  }
18253
18579
 
18254
- // TODO: If the suspense fiber has already rendered the primary children
18255
- // without suspending (that is, all of the promises have already resolved),
18256
- // we should not trigger another update here. One case this happens is when
18257
- // we are in sync mode and a single promise is thrown both on initial render
18258
- // and on update; we attach two .then(retrySuspendedRoot) callbacks and each
18259
- // one performs Sync work, rerendering the Suspense.
18260
-
18261
- if ((boundaryFiber.mode & ConcurrentMode) !== NoContext) {
18262
- if (root === nextRoot && nextRenderExpirationTime === suspendedTime) {
18263
- // Received a ping at the same priority level at which we're currently
18264
- // rendering. Restart from the root.
18265
- nextRoot = null;
18580
+ if (nextRoot !== null && nextRenderExpirationTime === pingTime) {
18581
+ // Received a ping at the same priority level at which we're currently
18582
+ // rendering. Restart from the root.
18583
+ nextRoot = null;
18584
+ } else {
18585
+ // Confirm that the root is still suspended at this level. Otherwise exit.
18586
+ if (isPriorityLevelSuspended(root, pingTime)) {
18587
+ // Ping at the original level
18588
+ markPingedPriorityLevel(root, pingTime);
18589
+ var rootExpirationTime = root.expirationTime;
18590
+ if (rootExpirationTime !== NoWork) {
18591
+ requestWork(root, rootExpirationTime);
18592
+ }
18266
18593
  }
18267
18594
  }
18595
+ }
18268
18596
 
18269
- scheduleWorkToRoot(boundaryFiber, retryTime);
18270
- if ((boundaryFiber.mode & ConcurrentMode) === NoContext) {
18271
- // Outside of concurrent mode, we must schedule an update on the source
18272
- // fiber, too, since it already committed in an inconsistent state and
18273
- // therefore does not have any pending work.
18274
- scheduleWorkToRoot(sourceFiber, retryTime);
18275
- var sourceTag = sourceFiber.tag;
18276
- if (sourceTag === ClassComponent && sourceFiber.stateNode !== null) {
18277
- // When we try rendering again, we should not reuse the current fiber,
18278
- // since it's known to be in an inconsistent state. Use a force updte to
18279
- // prevent a bail out.
18280
- var update = createUpdate(retryTime);
18281
- update.tag = ForceUpdate;
18282
- enqueueUpdate(sourceFiber, update);
18283
- }
18597
+ function retryTimedOutBoundary(boundaryFiber, thenable) {
18598
+ // The boundary fiber (a Suspense component) previously timed out and was
18599
+ // rendered in its fallback state. One of the promises that suspended it has
18600
+ // resolved, which means at least part of the tree was likely unblocked. Try
18601
+ var retryCache = boundaryFiber.stateNode;
18602
+ if (retryCache !== null) {
18603
+ // The thenable resolved, so we no longer need to memoize, because it will
18604
+ // never be thrown again.
18605
+ retryCache.delete(thenable);
18284
18606
  }
18285
18607
 
18286
- var rootExpirationTime = root.expirationTime;
18287
- if (rootExpirationTime !== NoWork) {
18288
- requestWork(root, rootExpirationTime);
18608
+ var currentTime = requestCurrentTime();
18609
+ var retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
18610
+ var root = scheduleWorkToRoot(boundaryFiber, retryTime);
18611
+ if (root !== null) {
18612
+ markPendingPriorityLevel(root, retryTime);
18613
+ var rootExpirationTime = root.expirationTime;
18614
+ if (rootExpirationTime !== NoWork) {
18615
+ requestWork(root, rootExpirationTime);
18616
+ }
18289
18617
  }
18290
18618
  }
18291
18619
 
@@ -19175,10 +19503,40 @@ function findHostInstanceWithNoPortals(fiber) {
19175
19503
  return hostFiber.stateNode;
19176
19504
  }
19177
19505
 
19506
+ var overrideProps = null;
19507
+
19508
+ {
19509
+ var copyWithSetImpl = function (obj, path, idx, value) {
19510
+ if (idx >= path.length) {
19511
+ return value;
19512
+ }
19513
+ var key = path[idx];
19514
+ var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
19515
+ // $FlowFixMe number or string is fine here
19516
+ updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
19517
+ return updated;
19518
+ };
19519
+
19520
+ var copyWithSet = function (obj, path, value) {
19521
+ return copyWithSetImpl(obj, path, 0, value);
19522
+ };
19523
+
19524
+ // Support DevTools props for function components, forwardRef, memo, host components, etc.
19525
+ overrideProps = function (fiber, path, value) {
19526
+ flushPassiveEffects();
19527
+ fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
19528
+ if (fiber.alternate) {
19529
+ fiber.alternate.pendingProps = fiber.pendingProps;
19530
+ }
19531
+ scheduleWork(fiber, Sync);
19532
+ };
19533
+ }
19534
+
19178
19535
  function injectIntoDevTools(devToolsConfig) {
19179
19536
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
19180
19537
 
19181
19538
  return injectInternals(_assign({}, devToolsConfig, {
19539
+ overrideProps: overrideProps,
19182
19540
  findHostInstanceByFiber: function (fiber) {
19183
19541
  var hostFiber = findCurrentHostFiber(fiber);
19184
19542
  if (hostFiber === null) {
@@ -19216,7 +19574,7 @@ implementation) {
19216
19574
 
19217
19575
  // TODO: this is special because it gets imported during build.
19218
19576
 
19219
- var ReactVersion = '16.6.3';
19577
+ var ReactVersion = '16.7.0';
19220
19578
 
19221
19579
  // TODO: This type is shared between the reconciler and ReactDOM, but will
19222
19580
  // eventually be lifted out to the renderer.
@@ -19574,7 +19932,7 @@ function legacyRenderSubtreeIntoContainer(parentComponent, children, container,
19574
19932
  return getPublicRootInstance(root._internalRoot);
19575
19933
  }
19576
19934
 
19577
- function createPortal(children, container) {
19935
+ function createPortal$$1(children, container) {
19578
19936
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
19579
19937
 
19580
19938
  !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
@@ -19583,7 +19941,7 @@ function createPortal(children, container) {
19583
19941
  }
19584
19942
 
19585
19943
  var ReactDOM = {
19586
- createPortal: createPortal,
19944
+ createPortal: createPortal$$1,
19587
19945
 
19588
19946
  findDOMNode: function (componentOrElement) {
19589
19947
  {
@@ -19658,7 +20016,7 @@ var ReactDOM = {
19658
20016
  didWarnAboutUnstableCreatePortal = true;
19659
20017
  lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
19660
20018
  }
19661
- return createPortal.apply(undefined, arguments);
20019
+ return createPortal$$1.apply(undefined, arguments);
19662
20020
  },
19663
20021
 
19664
20022
 
@@ -19668,6 +20026,7 @@ var ReactDOM = {
19668
20026
 
19669
20027
  flushSync: flushSync,
19670
20028
 
20029
+ unstable_createRoot: createRoot,
19671
20030
  unstable_flushControlled: flushControlled,
19672
20031
 
19673
20032
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
@@ -19686,8 +20045,7 @@ function createRoot(container, options) {
19686
20045
 
19687
20046
  if (enableStableConcurrentModeAPIs) {
19688
20047
  ReactDOM.createRoot = createRoot;
19689
- } else {
19690
- ReactDOM.unstable_createRoot = createRoot;
20048
+ ReactDOM.unstable_createRoot = undefined;
19691
20049
  }
19692
20050
 
19693
20051
  var foundDevTools = injectIntoDevTools({