react-dom 16.7.0-alpha.2 → 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 +14 -12
  3. package/cjs/react-dom-server.browser.production.min.js +37 -41
  4. package/cjs/react-dom-server.node.development.js +16 -13
  5. package/cjs/react-dom-server.node.production.min.js +39 -43
  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 +349 -112
  18. package/cjs/react-dom.production.min.js +209 -219
  19. package/cjs/react-dom.profiling.min.js +194 -204
  20. package/package.json +58 -20
  21. package/umd/react-dom-server.browser.development.js +14 -12
  22. package/umd/react-dom-server.browser.production.min.js +33 -36
  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 +352 -112
  33. package/umd/react-dom.production.min.js +195 -201
  34. package/umd/react-dom.profiling.min.js +202 -210
  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.7.0-alpha.2
1
+ /** @license React v16.7.0
2
2
  * react-dom.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -2512,13 +2512,14 @@ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2512
2512
 
2513
2513
  function describeFiber(fiber) {
2514
2514
  switch (fiber.tag) {
2515
- case IndeterminateComponent:
2516
- case LazyComponent:
2517
- case FunctionComponent:
2518
- case ClassComponent:
2519
- case HostComponent:
2520
- case Mode:
2521
- case SuspenseComponent:
2515
+ case HostRoot:
2516
+ case HostPortal:
2517
+ case HostText:
2518
+ case Fragment:
2519
+ case ContextProvider:
2520
+ case ContextConsumer:
2521
+ return '';
2522
+ default:
2522
2523
  var owner = fiber._debugOwner;
2523
2524
  var source = fiber._debugSource;
2524
2525
  var name = getComponentName(fiber.type);
@@ -2527,8 +2528,6 @@ function describeFiber(fiber) {
2527
2528
  ownerName = getComponentName(owner.type);
2528
2529
  }
2529
2530
  return describeComponentFrame(name, source, ownerName);
2530
- default:
2531
- return '';
2532
2531
  }
2533
2532
  }
2534
2533
 
@@ -3219,7 +3218,7 @@ var ReactControlledValuePropTypes = {
3219
3218
 
3220
3219
  var enableUserTimingAPI = true;
3221
3220
 
3222
- var enableHooks = true;
3221
+ var enableHooks = false;
3223
3222
  // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
3224
3223
  var debugRenderPhaseSideEffects = false;
3225
3224
 
@@ -3242,6 +3241,9 @@ var enableProfilerTimer = true;
3242
3241
  // Trace which interactions trigger each commit.
3243
3242
  var enableSchedulerTracing = true;
3244
3243
 
3244
+ // Only used in www builds.
3245
+ // TODO: true? Here it might just be false.
3246
+
3245
3247
  // Only used in www builds.
3246
3248
 
3247
3249
 
@@ -3254,7 +3256,9 @@ var disableInputAttributeSyncing = false;
3254
3256
 
3255
3257
  // These APIs will no longer be "unstable" in the upcoming 16.7 release,
3256
3258
  // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
3257
- var enableStableConcurrentModeAPIs = true;
3259
+ var enableStableConcurrentModeAPIs = false;
3260
+
3261
+ var warnAboutShorthandPropertyCollision = false;
3258
3262
 
3259
3263
  // TODO: direct imports like some-package/src/* are bad. Fix me.
3260
3264
  var didWarnValueDefaultValue = false;
@@ -6563,6 +6567,10 @@ function expandShorthandMap(styles) {
6563
6567
  * becomes .style.fontVariant = ''
6564
6568
  */
6565
6569
  function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
6570
+ if (!warnAboutShorthandPropertyCollision) {
6571
+ return;
6572
+ }
6573
+
6566
6574
  if (!nextStyles) {
6567
6575
  return;
6568
6576
  }
@@ -8703,6 +8711,9 @@ var unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback;
8703
8711
  var unstable_now = _ReactInternals$Sched.unstable_now;
8704
8712
  var unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback;
8705
8713
  var unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield;
8714
+ var unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode;
8715
+ var unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution;
8716
+ var unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution;
8706
8717
 
8707
8718
  // Renderers that don't support persistence
8708
8719
  // can re-export everything from this module.
@@ -9983,6 +9994,26 @@ function FiberNode(tag, pendingProps, key, mode) {
9983
9994
  this.alternate = null;
9984
9995
 
9985
9996
  if (enableProfilerTimer) {
9997
+ // Note: The following is done to avoid a v8 performance cliff.
9998
+ //
9999
+ // Initializing the fields below to smis and later updating them with
10000
+ // double values will cause Fibers to end up having separate shapes.
10001
+ // This behavior/bug has something to do with Object.preventExtension().
10002
+ // Fortunately this only impacts DEV builds.
10003
+ // Unfortunately it makes React unusably slow for some applications.
10004
+ // To work around this, initialize the fields below with doubles.
10005
+ //
10006
+ // Learn more about this here:
10007
+ // https://github.com/facebook/react/issues/14365
10008
+ // https://bugs.chromium.org/p/v8/issues/detail?id=8538
10009
+ this.actualDuration = Number.NaN;
10010
+ this.actualStartTime = Number.NaN;
10011
+ this.selfBaseDuration = Number.NaN;
10012
+ this.treeBaseDuration = Number.NaN;
10013
+
10014
+ // It's okay to replace the initial doubles with smis after initialization.
10015
+ // This won't trigger the performance cliff mentioned above,
10016
+ // and it simplifies other profiler code (including DevTools).
9986
10017
  this.actualDuration = 0;
9987
10018
  this.actualStartTime = -1;
9988
10019
  this.selfBaseDuration = 0;
@@ -10378,6 +10409,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) {
10378
10409
  latestSuspendedTime: NoWork,
10379
10410
  latestPingedTime: NoWork,
10380
10411
 
10412
+ pingCache: null,
10413
+
10381
10414
  didError: false,
10382
10415
 
10383
10416
  pendingCommitExpirationTime: NoWork,
@@ -10401,6 +10434,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) {
10401
10434
  containerInfo: containerInfo,
10402
10435
  pendingChildren: null,
10403
10436
 
10437
+ pingCache: null,
10438
+
10404
10439
  earliestPendingTime: NoWork,
10405
10440
  latestPendingTime: NoWork,
10406
10441
  earliestSuspendedTime: NoWork,
@@ -10775,6 +10810,10 @@ function markCommittedPriorityLevels(root, earliestRemainingTime) {
10775
10810
  return;
10776
10811
  }
10777
10812
 
10813
+ if (earliestRemainingTime < root.latestPingedTime) {
10814
+ root.latestPingedTime = NoWork;
10815
+ }
10816
+
10778
10817
  // Let's see if the previous latest known pending level was just flushed.
10779
10818
  var latestPendingTime = root.latestPendingTime;
10780
10819
  if (latestPendingTime !== NoWork) {
@@ -10900,10 +10939,8 @@ function markPingedPriorityLevel(root, pingedTime) {
10900
10939
  }
10901
10940
 
10902
10941
  function clearPing(root, completedTime) {
10903
- // TODO: Track whether the root was pinged during the render phase. If so,
10904
- // we need to make sure we don't lose track of it.
10905
10942
  var latestPingedTime = root.latestPingedTime;
10906
- if (latestPingedTime !== NoWork && latestPingedTime >= completedTime) {
10943
+ if (latestPingedTime >= completedTime) {
10907
10944
  root.latestPingedTime = NoWork;
10908
10945
  }
10909
10946
  }
@@ -11854,7 +11891,7 @@ function cloneHook(hook) {
11854
11891
  return {
11855
11892
  memoizedState: hook.memoizedState,
11856
11893
 
11857
- baseState: hook.memoizedState,
11894
+ baseState: hook.baseState,
11858
11895
  queue: hook.queue,
11859
11896
  baseUpdate: hook.baseUpdate,
11860
11897
 
@@ -12099,10 +12136,6 @@ function useRef(initialValue) {
12099
12136
  return ref;
12100
12137
  }
12101
12138
 
12102
- function useMutationEffect(create, inputs) {
12103
- useEffectImpl(Snapshot | Update, UnmountSnapshot | MountMutation, create, inputs);
12104
- }
12105
-
12106
12139
  function useLayoutEffect(create, inputs) {
12107
12140
  useEffectImpl(Update, UnmountMutation | MountLayout, create, inputs);
12108
12141
  }
@@ -12137,7 +12170,7 @@ function useImperativeMethods(ref, create, inputs) {
12137
12170
  // TODO: I've implemented this on top of useEffect because it's almost the
12138
12171
  // same thing, and it would require an equal amount of code. It doesn't seem
12139
12172
  // like a common enough use case to justify the additional size.
12140
- useEffectImpl(Update, UnmountMutation | MountLayout, function () {
12173
+ useLayoutEffect(function () {
12141
12174
  if (typeof ref === 'function') {
12142
12175
  var refCallback = ref;
12143
12176
  var _inst = create();
@@ -14299,12 +14332,14 @@ var didWarnAboutBadClass = void 0;
14299
14332
  var didWarnAboutContextTypeOnFunctionComponent = void 0;
14300
14333
  var didWarnAboutGetDerivedStateOnFunctionComponent = void 0;
14301
14334
  var didWarnAboutFunctionRefs = void 0;
14335
+ var didWarnAboutReassigningProps = void 0;
14302
14336
 
14303
14337
  {
14304
14338
  didWarnAboutBadClass = {};
14305
14339
  didWarnAboutContextTypeOnFunctionComponent = {};
14306
14340
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
14307
14341
  didWarnAboutFunctionRefs = {};
14342
+ didWarnAboutReassigningProps = false;
14308
14343
  }
14309
14344
 
14310
14345
  function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
@@ -14343,6 +14378,18 @@ function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildre
14343
14378
  }
14344
14379
 
14345
14380
  function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14381
+ {
14382
+ if (workInProgress.type !== workInProgress.elementType) {
14383
+ // Lazy component props can't be validated in createElement
14384
+ // because they're only guaranteed to be resolved here.
14385
+ var innerPropTypes = Component.propTypes;
14386
+ if (innerPropTypes) {
14387
+ checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
14388
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14389
+ }
14390
+ }
14391
+ }
14392
+
14346
14393
  var render = Component.render;
14347
14394
  var ref = workInProgress.ref;
14348
14395
 
@@ -14367,7 +14414,9 @@ function updateForwardRef(current$$1, workInProgress, Component, nextProps, rend
14367
14414
  function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
14368
14415
  if (current$$1 === null) {
14369
14416
  var type = Component.type;
14370
- if (isSimpleFunctionComponent(type) && Component.compare === null) {
14417
+ if (isSimpleFunctionComponent(type) && Component.compare === null &&
14418
+ // SimpleMemoComponent codepath doesn't resolve outer props either.
14419
+ Component.defaultProps === undefined) {
14371
14420
  // If this is a plain function component without default props,
14372
14421
  // and with only the default shallow comparison, we upgrade it
14373
14422
  // to a SimpleMemoComponent to allow fast path updates.
@@ -14378,12 +14427,31 @@ function updateMemoComponent(current$$1, workInProgress, Component, nextProps, u
14378
14427
  }
14379
14428
  return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime);
14380
14429
  }
14430
+ {
14431
+ var innerPropTypes = type.propTypes;
14432
+ if (innerPropTypes) {
14433
+ // Inner memo component props aren't currently validated in createElement.
14434
+ // We could move it there, but we'd still need this for lazy code path.
14435
+ checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
14436
+ 'prop', getComponentName(type), getCurrentFiberStackInDev);
14437
+ }
14438
+ }
14381
14439
  var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
14382
14440
  child.ref = workInProgress.ref;
14383
14441
  child.return = workInProgress;
14384
14442
  workInProgress.child = child;
14385
14443
  return child;
14386
14444
  }
14445
+ {
14446
+ var _type = Component.type;
14447
+ var _innerPropTypes = _type.propTypes;
14448
+ if (_innerPropTypes) {
14449
+ // Inner memo component props aren't currently validated in createElement.
14450
+ // We could move it there, but we'd still need this for lazy code path.
14451
+ checkPropTypes_1(_innerPropTypes, nextProps, // Resolved props
14452
+ 'prop', getComponentName(_type), getCurrentFiberStackInDev);
14453
+ }
14454
+ }
14387
14455
  var currentChild = current$$1.child; // This is always exactly one child
14388
14456
  if (updateExpirationTime < renderExpirationTime) {
14389
14457
  // This will be the props with resolved defaultProps,
@@ -14406,6 +14474,25 @@ function updateMemoComponent(current$$1, workInProgress, Component, nextProps, u
14406
14474
  }
14407
14475
 
14408
14476
  function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
14477
+ {
14478
+ if (workInProgress.type !== workInProgress.elementType) {
14479
+ // Lazy component props can't be validated in createElement
14480
+ // because they're only guaranteed to be resolved here.
14481
+ var outerMemoType = workInProgress.elementType;
14482
+ if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
14483
+ // We warn when you define propTypes on lazy()
14484
+ // so let's just skip over it to find memo() outer wrapper.
14485
+ // Inner props for memo are validated later.
14486
+ outerMemoType = refineResolvedLazyComponent(outerMemoType);
14487
+ }
14488
+ var outerPropTypes = outerMemoType && outerMemoType.propTypes;
14489
+ if (outerPropTypes) {
14490
+ checkPropTypes_1(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
14491
+ 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
14492
+ }
14493
+ // Inner propTypes will be validated in the function component path.
14494
+ }
14495
+ }
14409
14496
  if (current$$1 !== null && updateExpirationTime < renderExpirationTime) {
14410
14497
  var prevProps = current$$1.memoizedProps;
14411
14498
  if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
@@ -14446,6 +14533,18 @@ function markRef(current$$1, workInProgress) {
14446
14533
  }
14447
14534
 
14448
14535
  function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14536
+ {
14537
+ if (workInProgress.type !== workInProgress.elementType) {
14538
+ // Lazy component props can't be validated in createElement
14539
+ // because they're only guaranteed to be resolved here.
14540
+ var innerPropTypes = Component.propTypes;
14541
+ if (innerPropTypes) {
14542
+ checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
14543
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14544
+ }
14545
+ }
14546
+ }
14547
+
14449
14548
  var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
14450
14549
  var context = getMaskedContext(workInProgress, unmaskedContext);
14451
14550
 
@@ -14467,6 +14566,18 @@ function updateFunctionComponent(current$$1, workInProgress, Component, nextProp
14467
14566
  }
14468
14567
 
14469
14568
  function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
14569
+ {
14570
+ if (workInProgress.type !== workInProgress.elementType) {
14571
+ // Lazy component props can't be validated in createElement
14572
+ // because they're only guaranteed to be resolved here.
14573
+ var innerPropTypes = Component.propTypes;
14574
+ if (innerPropTypes) {
14575
+ checkPropTypes_1(innerPropTypes, nextProps, // Resolved props
14576
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14577
+ }
14578
+ }
14579
+ }
14580
+
14470
14581
  // Push context providers early to prevent context stack mismatches.
14471
14582
  // During mounting we don't know the child context yet as the instance doesn't exist.
14472
14583
  // We will invalidate the child context in finishClassComponent() right after rendering.
@@ -14502,7 +14613,15 @@ function updateClassComponent(current$$1, workInProgress, Component, nextProps,
14502
14613
  } else {
14503
14614
  shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
14504
14615
  }
14505
- return finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
14616
+ var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
14617
+ {
14618
+ var inst = workInProgress.stateNode;
14619
+ if (inst.props !== nextProps) {
14620
+ !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;
14621
+ didWarnAboutReassigningProps = true;
14622
+ }
14623
+ }
14624
+ return nextUnitOfWork;
14506
14625
  }
14507
14626
 
14508
14627
  function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
@@ -14715,16 +14834,31 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat
14715
14834
  }
14716
14835
  case MemoComponent:
14717
14836
  {
14837
+ {
14838
+ if (workInProgress.type !== workInProgress.elementType) {
14839
+ var outerPropTypes = Component.propTypes;
14840
+ if (outerPropTypes) {
14841
+ checkPropTypes_1(outerPropTypes, resolvedProps, // Resolved for outer only
14842
+ 'prop', getComponentName(Component), getCurrentFiberStackInDev);
14843
+ }
14844
+ }
14845
+ }
14718
14846
  child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
14719
14847
  updateExpirationTime, renderExpirationTime);
14720
14848
  break;
14721
14849
  }
14722
14850
  default:
14723
14851
  {
14852
+ var hint = '';
14853
+ {
14854
+ if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
14855
+ hint = ' Did you wrap a component in React.lazy() more than once?';
14856
+ }
14857
+ }
14724
14858
  // This message intentionally doesn't mention ForwardRef or MemoComponent
14725
14859
  // because the fact that it's a separate type of work is an
14726
14860
  // implementation detail.
14727
- invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Promise elements must resolve to a class or function.', Component);
14861
+ 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);
14728
14862
  }
14729
14863
  }
14730
14864
  return child;
@@ -15085,6 +15219,7 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
15085
15219
  next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
15086
15220
  }
15087
15221
  }
15222
+ workInProgress.stateNode = current$$1.stateNode;
15088
15223
  }
15089
15224
 
15090
15225
  workInProgress.memoizedState = nextState;
@@ -15355,10 +15490,21 @@ function beginWork(current$$1, workInProgress, renderExpirationTime) {
15355
15490
  return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
15356
15491
  case MemoComponent:
15357
15492
  {
15358
- var _type = workInProgress.type;
15493
+ var _type2 = workInProgress.type;
15359
15494
  var _unresolvedProps3 = workInProgress.pendingProps;
15360
- var _resolvedProps3 = resolveDefaultProps(_type.type, _unresolvedProps3);
15361
- return updateMemoComponent(current$$1, workInProgress, _type, _resolvedProps3, updateExpirationTime, renderExpirationTime);
15495
+ // Resolve outer props first, then resolve inner props.
15496
+ var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
15497
+ {
15498
+ if (workInProgress.type !== workInProgress.elementType) {
15499
+ var outerPropTypes = _type2.propTypes;
15500
+ if (outerPropTypes) {
15501
+ checkPropTypes_1(outerPropTypes, _resolvedProps3, // Resolved for outer only
15502
+ 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
15503
+ }
15504
+ }
15505
+ }
15506
+ _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
15507
+ return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
15362
15508
  }
15363
15509
  case SimpleMemoComponent:
15364
15510
  {
@@ -15917,7 +16063,7 @@ function completeWork(current, workInProgress, renderExpirationTime) {
15917
16063
  return null;
15918
16064
  }
15919
16065
 
15920
- function shouldCaptureSuspense(current, workInProgress) {
16066
+ function shouldCaptureSuspense(workInProgress) {
15921
16067
  // In order to capture, the Suspense component must have a fallback prop.
15922
16068
  if (workInProgress.memoizedProps.fallback === undefined) {
15923
16069
  return false;
@@ -16000,6 +16146,8 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
16000
16146
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
16001
16147
  }
16002
16148
 
16149
+ var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
16150
+
16003
16151
  function logError(boundary, errorInfo) {
16004
16152
  var source = errorInfo.source;
16005
16153
  var stack = errorInfo.stack;
@@ -16104,9 +16252,9 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
16104
16252
  // but instead we rely on them being set during last render.
16105
16253
  // TODO: revisit this when we implement resuming.
16106
16254
  {
16107
- if (finishedWork.type === finishedWork.elementType) {
16108
- !(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;
16109
- !(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;
16255
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16256
+ !(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;
16257
+ !(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;
16110
16258
  }
16111
16259
  }
16112
16260
  var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
@@ -16162,7 +16310,7 @@ function commitHookEffectList(unmountTag, mountTag, finishedWork) {
16162
16310
  if (typeof _destroy !== 'function') {
16163
16311
  {
16164
16312
  if (_destroy !== null && _destroy !== undefined) {
16165
- 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));
16313
+ 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));
16166
16314
  }
16167
16315
  }
16168
16316
  _destroy = null;
@@ -16198,9 +16346,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
16198
16346
  // but instead we rely on them being set during last render.
16199
16347
  // TODO: revisit this when we implement resuming.
16200
16348
  {
16201
- if (finishedWork.type === finishedWork.elementType) {
16202
- !(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;
16203
- !(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;
16349
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16350
+ !(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;
16351
+ !(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;
16204
16352
  }
16205
16353
  }
16206
16354
  instance.componentDidMount();
@@ -16213,9 +16361,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
16213
16361
  // but instead we rely on them being set during last render.
16214
16362
  // TODO: revisit this when we implement resuming.
16215
16363
  {
16216
- if (finishedWork.type === finishedWork.elementType) {
16217
- !(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;
16218
- !(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;
16364
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16365
+ !(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;
16366
+ !(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;
16219
16367
  }
16220
16368
  }
16221
16369
  instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
@@ -16225,9 +16373,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
16225
16373
  var updateQueue = finishedWork.updateQueue;
16226
16374
  if (updateQueue !== null) {
16227
16375
  {
16228
- if (finishedWork.type === finishedWork.elementType) {
16229
- !(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;
16230
- !(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;
16376
+ if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16377
+ !(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;
16378
+ !(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;
16231
16379
  }
16232
16380
  }
16233
16381
  // We could update instance props and state here,
@@ -16486,9 +16634,14 @@ function detachFiber(current$$1) {
16486
16634
  // itself will be GC:ed when the parent updates the next time.
16487
16635
  current$$1.return = null;
16488
16636
  current$$1.child = null;
16489
- if (current$$1.alternate) {
16490
- current$$1.alternate.child = null;
16491
- current$$1.alternate.return = null;
16637
+ current$$1.memoizedState = null;
16638
+ current$$1.updateQueue = null;
16639
+ var alternate = current$$1.alternate;
16640
+ if (alternate !== null) {
16641
+ alternate.return = null;
16642
+ alternate.child = null;
16643
+ alternate.memoizedState = null;
16644
+ alternate.updateQueue = null;
16492
16645
  }
16493
16646
  }
16494
16647
 
@@ -16777,6 +16930,8 @@ function commitWork(current$$1, finishedWork) {
16777
16930
  case MemoComponent:
16778
16931
  case SimpleMemoComponent:
16779
16932
  {
16933
+ // Note: We currently never use MountMutation, but useLayout uses
16934
+ // UnmountMutation.
16780
16935
  commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
16781
16936
  return;
16782
16937
  }
@@ -16792,6 +16947,8 @@ function commitWork(current$$1, finishedWork) {
16792
16947
  case MemoComponent:
16793
16948
  case SimpleMemoComponent:
16794
16949
  {
16950
+ // Note: We currently never use MountMutation, but useLayout uses
16951
+ // UnmountMutation.
16795
16952
  commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
16796
16953
  return;
16797
16954
  }
@@ -16861,6 +17018,30 @@ function commitWork(current$$1, finishedWork) {
16861
17018
  if (primaryChildParent !== null) {
16862
17019
  hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
16863
17020
  }
17021
+
17022
+ // If this boundary just timed out, then it will have a set of thenables.
17023
+ // For each thenable, attach a listener so that when it resolves, React
17024
+ // attempts to re-render the boundary in the primary (pre-timeout) state.
17025
+ var thenables = finishedWork.updateQueue;
17026
+ if (thenables !== null) {
17027
+ finishedWork.updateQueue = null;
17028
+ var retryCache = finishedWork.stateNode;
17029
+ if (retryCache === null) {
17030
+ retryCache = finishedWork.stateNode = new PossiblyWeakSet();
17031
+ }
17032
+ thenables.forEach(function (thenable) {
17033
+ // Memoize using the boundary fiber to prevent redundant listeners.
17034
+ var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
17035
+ if (enableSchedulerTracing) {
17036
+ retry = unstable_wrap(retry);
17037
+ }
17038
+ if (!retryCache.has(thenable)) {
17039
+ retryCache.add(thenable);
17040
+ thenable.then(retry, retry);
17041
+ }
17042
+ });
17043
+ }
17044
+
16864
17045
  return;
16865
17046
  }
16866
17047
  case IncompleteClassComponent:
@@ -16881,6 +17062,8 @@ function commitResetTextContent(current$$1) {
16881
17062
  resetTextContent(current$$1.stateNode);
16882
17063
  }
16883
17064
 
17065
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
17066
+
16884
17067
  function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
16885
17068
  var update = createUpdate(expirationTime);
16886
17069
  // Unmount the root by rendering null.
@@ -16984,19 +17167,16 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
16984
17167
  // Schedule the nearest Suspense to re-render the timed out view.
16985
17168
  _workInProgress = returnFiber;
16986
17169
  do {
16987
- if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress.alternate, _workInProgress)) {
17170
+ if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) {
16988
17171
  // Found the nearest boundary.
16989
17172
 
16990
- // If the boundary is not in concurrent mode, we should not suspend, and
16991
- // likewise, when the promise resolves, we should ping synchronously.
16992
- var pingTime = (_workInProgress.mode & ConcurrentMode) === NoEffect ? Sync : renderExpirationTime;
16993
-
16994
- // Attach a listener to the promise to "ping" the root and retry.
16995
- var onResolveOrReject = retrySuspendedRoot.bind(null, root, _workInProgress, sourceFiber, pingTime);
16996
- if (enableSchedulerTracing) {
16997
- onResolveOrReject = unstable_wrap(onResolveOrReject);
17173
+ // Stash the promise on the boundary fiber. If the boundary times out, we'll
17174
+ var thenables = _workInProgress.updateQueue;
17175
+ if (thenables === null) {
17176
+ _workInProgress.updateQueue = new Set([thenable]);
17177
+ } else {
17178
+ thenables.add(thenable);
16998
17179
  }
16999
- thenable.then(onResolveOrReject, onResolveOrReject);
17000
17180
 
17001
17181
  // If the boundary is outside of concurrent mode, we should *not*
17002
17182
  // suspend the commit. Pretend as if the suspended component rendered
@@ -17015,18 +17195,25 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
17015
17195
  sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
17016
17196
 
17017
17197
  if (sourceFiber.tag === ClassComponent) {
17018
- var _current = sourceFiber.alternate;
17019
- if (_current === null) {
17198
+ var currentSourceFiber = sourceFiber.alternate;
17199
+ if (currentSourceFiber === null) {
17020
17200
  // This is a new mount. Change the tag so it's not mistaken for a
17021
17201
  // completed class component. For example, we should not call
17022
17202
  // componentWillUnmount if it is deleted.
17023
17203
  sourceFiber.tag = IncompleteClassComponent;
17204
+ } else {
17205
+ // When we try rendering again, we should not reuse the current fiber,
17206
+ // since it's known to be in an inconsistent state. Use a force updte to
17207
+ // prevent a bail out.
17208
+ var update = createUpdate(Sync);
17209
+ update.tag = ForceUpdate;
17210
+ enqueueUpdate(sourceFiber, update);
17024
17211
  }
17025
17212
  }
17026
17213
 
17027
- // The source fiber did not complete. Mark it with the current
17028
- // render priority to indicate that it still has pending work.
17029
- sourceFiber.expirationTime = renderExpirationTime;
17214
+ // The source fiber did not complete. Mark it with Sync priority to
17215
+ // indicate that it still has pending work.
17216
+ sourceFiber.expirationTime = Sync;
17030
17217
 
17031
17218
  // Exit without suspending.
17032
17219
  return;
@@ -17035,6 +17222,32 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
17035
17222
  // Confirmed that the boundary is in a concurrent mode tree. Continue
17036
17223
  // with the normal suspend path.
17037
17224
 
17225
+ // Attach a listener to the promise to "ping" the root and retry. But
17226
+ // only if one does not already exist for the current render expiration
17227
+ // time (which acts like a "thread ID" here).
17228
+ var pingCache = root.pingCache;
17229
+ var threadIDs = void 0;
17230
+ if (pingCache === null) {
17231
+ pingCache = root.pingCache = new PossiblyWeakMap();
17232
+ threadIDs = new Set();
17233
+ pingCache.set(thenable, threadIDs);
17234
+ } else {
17235
+ threadIDs = pingCache.get(thenable);
17236
+ if (threadIDs === undefined) {
17237
+ threadIDs = new Set();
17238
+ pingCache.set(thenable, threadIDs);
17239
+ }
17240
+ }
17241
+ if (!threadIDs.has(renderExpirationTime)) {
17242
+ // Memoize using the thread ID to prevent redundant listeners.
17243
+ threadIDs.add(renderExpirationTime);
17244
+ var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
17245
+ if (enableSchedulerTracing) {
17246
+ ping = unstable_wrap(ping);
17247
+ }
17248
+ thenable.then(ping, ping);
17249
+ }
17250
+
17038
17251
  var absoluteTimeoutMs = void 0;
17039
17252
  if (earliestTimeoutMs === -1) {
17040
17253
  // If no explicit threshold is given, default to an abitrarily large
@@ -17091,8 +17304,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
17091
17304
  var _errorInfo = value;
17092
17305
  workInProgress.effectTag |= ShouldCapture;
17093
17306
  workInProgress.expirationTime = renderExpirationTime;
17094
- var update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
17095
- enqueueCapturedUpdate(workInProgress, update);
17307
+ var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
17308
+ enqueueCapturedUpdate(workInProgress, _update);
17096
17309
  return;
17097
17310
  }
17098
17311
  case ClassComponent:
@@ -17104,8 +17317,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
17104
17317
  workInProgress.effectTag |= ShouldCapture;
17105
17318
  workInProgress.expirationTime = renderExpirationTime;
17106
17319
  // Schedule the error boundary to re-render using updated state
17107
- var _update = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
17108
- enqueueCapturedUpdate(workInProgress, _update);
17320
+ var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
17321
+ enqueueCapturedUpdate(workInProgress, _update2);
17109
17322
  return;
17110
17323
  }
17111
17324
  break;
@@ -17206,7 +17419,6 @@ var Dispatcher = {
17206
17419
  useImperativeMethods: useImperativeMethods,
17207
17420
  useLayoutEffect: useLayoutEffect,
17208
17421
  useMemo: useMemo,
17209
- useMutationEffect: useMutationEffect,
17210
17422
  useReducer: useReducer,
17211
17423
  useRef: useRef,
17212
17424
  useState: useState
@@ -18481,56 +18693,54 @@ function renderDidError() {
18481
18693
  nextRenderDidError = true;
18482
18694
  }
18483
18695
 
18484
- function retrySuspendedRoot(root, boundaryFiber, sourceFiber, suspendedTime) {
18485
- var retryTime = void 0;
18486
-
18487
- if (isPriorityLevelSuspended(root, suspendedTime)) {
18488
- // Ping at the original level
18489
- retryTime = suspendedTime;
18696
+ function pingSuspendedRoot(root, thenable, pingTime) {
18697
+ // A promise that previously suspended React from committing has resolved.
18698
+ // If React is still suspended, try again at the previous level (pingTime).
18490
18699
 
18491
- markPingedPriorityLevel(root, retryTime);
18492
- } else {
18493
- // Suspense already timed out. Compute a new expiration time
18494
- var currentTime = requestCurrentTime();
18495
- retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
18496
- markPendingPriorityLevel(root, retryTime);
18700
+ var pingCache = root.pingCache;
18701
+ if (pingCache !== null) {
18702
+ // The thenable resolved, so we no longer need to memoize, because it will
18703
+ // never be thrown again.
18704
+ pingCache.delete(thenable);
18497
18705
  }
18498
18706
 
18499
- // TODO: If the suspense fiber has already rendered the primary children
18500
- // without suspending (that is, all of the promises have already resolved),
18501
- // we should not trigger another update here. One case this happens is when
18502
- // we are in sync mode and a single promise is thrown both on initial render
18503
- // and on update; we attach two .then(retrySuspendedRoot) callbacks and each
18504
- // one performs Sync work, rerendering the Suspense.
18505
-
18506
- if ((boundaryFiber.mode & ConcurrentMode) !== NoContext) {
18507
- if (root === nextRoot && nextRenderExpirationTime === suspendedTime) {
18508
- // Received a ping at the same priority level at which we're currently
18509
- // rendering. Restart from the root.
18510
- nextRoot = null;
18707
+ if (nextRoot !== null && nextRenderExpirationTime === pingTime) {
18708
+ // Received a ping at the same priority level at which we're currently
18709
+ // rendering. Restart from the root.
18710
+ nextRoot = null;
18711
+ } else {
18712
+ // Confirm that the root is still suspended at this level. Otherwise exit.
18713
+ if (isPriorityLevelSuspended(root, pingTime)) {
18714
+ // Ping at the original level
18715
+ markPingedPriorityLevel(root, pingTime);
18716
+ var rootExpirationTime = root.expirationTime;
18717
+ if (rootExpirationTime !== NoWork) {
18718
+ requestWork(root, rootExpirationTime);
18719
+ }
18511
18720
  }
18512
18721
  }
18722
+ }
18513
18723
 
18514
- scheduleWorkToRoot(boundaryFiber, retryTime);
18515
- if ((boundaryFiber.mode & ConcurrentMode) === NoContext) {
18516
- // Outside of concurrent mode, we must schedule an update on the source
18517
- // fiber, too, since it already committed in an inconsistent state and
18518
- // therefore does not have any pending work.
18519
- scheduleWorkToRoot(sourceFiber, retryTime);
18520
- var sourceTag = sourceFiber.tag;
18521
- if (sourceTag === ClassComponent && sourceFiber.stateNode !== null) {
18522
- // When we try rendering again, we should not reuse the current fiber,
18523
- // since it's known to be in an inconsistent state. Use a force updte to
18524
- // prevent a bail out.
18525
- var update = createUpdate(retryTime);
18526
- update.tag = ForceUpdate;
18527
- enqueueUpdate(sourceFiber, update);
18528
- }
18724
+ function retryTimedOutBoundary(boundaryFiber, thenable) {
18725
+ // The boundary fiber (a Suspense component) previously timed out and was
18726
+ // rendered in its fallback state. One of the promises that suspended it has
18727
+ // resolved, which means at least part of the tree was likely unblocked. Try
18728
+ var retryCache = boundaryFiber.stateNode;
18729
+ if (retryCache !== null) {
18730
+ // The thenable resolved, so we no longer need to memoize, because it will
18731
+ // never be thrown again.
18732
+ retryCache.delete(thenable);
18529
18733
  }
18530
18734
 
18531
- var rootExpirationTime = root.expirationTime;
18532
- if (rootExpirationTime !== NoWork) {
18533
- requestWork(root, rootExpirationTime);
18735
+ var currentTime = requestCurrentTime();
18736
+ var retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
18737
+ var root = scheduleWorkToRoot(boundaryFiber, retryTime);
18738
+ if (root !== null) {
18739
+ markPendingPriorityLevel(root, retryTime);
18740
+ var rootExpirationTime = root.expirationTime;
18741
+ if (rootExpirationTime !== NoWork) {
18742
+ requestWork(root, rootExpirationTime);
18743
+ }
18534
18744
  }
18535
18745
  }
18536
18746
 
@@ -19420,10 +19630,40 @@ function findHostInstanceWithNoPortals(fiber) {
19420
19630
  return hostFiber.stateNode;
19421
19631
  }
19422
19632
 
19633
+ var overrideProps = null;
19634
+
19635
+ {
19636
+ var copyWithSetImpl = function (obj, path, idx, value) {
19637
+ if (idx >= path.length) {
19638
+ return value;
19639
+ }
19640
+ var key = path[idx];
19641
+ var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
19642
+ // $FlowFixMe number or string is fine here
19643
+ updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
19644
+ return updated;
19645
+ };
19646
+
19647
+ var copyWithSet = function (obj, path, value) {
19648
+ return copyWithSetImpl(obj, path, 0, value);
19649
+ };
19650
+
19651
+ // Support DevTools props for function components, forwardRef, memo, host components, etc.
19652
+ overrideProps = function (fiber, path, value) {
19653
+ flushPassiveEffects();
19654
+ fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
19655
+ if (fiber.alternate) {
19656
+ fiber.alternate.pendingProps = fiber.pendingProps;
19657
+ }
19658
+ scheduleWork(fiber, Sync);
19659
+ };
19660
+ }
19661
+
19423
19662
  function injectIntoDevTools(devToolsConfig) {
19424
19663
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
19425
19664
 
19426
19665
  return injectInternals(_assign({}, devToolsConfig, {
19666
+ overrideProps: overrideProps,
19427
19667
  findHostInstanceByFiber: function (fiber) {
19428
19668
  var hostFiber = findCurrentHostFiber(fiber);
19429
19669
  if (hostFiber === null) {
@@ -19461,7 +19701,7 @@ implementation) {
19461
19701
 
19462
19702
  // TODO: this is special because it gets imported during build.
19463
19703
 
19464
- var ReactVersion = '16.7.0-alpha.2';
19704
+ var ReactVersion = '16.7.0';
19465
19705
 
19466
19706
  // TODO: This type is shared between the reconciler and ReactDOM, but will
19467
19707
  // eventually be lifted out to the renderer.
@@ -19819,7 +20059,7 @@ function legacyRenderSubtreeIntoContainer(parentComponent, children, container,
19819
20059
  return getPublicRootInstance(root._internalRoot);
19820
20060
  }
19821
20061
 
19822
- function createPortal(children, container) {
20062
+ function createPortal$$1(children, container) {
19823
20063
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
19824
20064
 
19825
20065
  !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
@@ -19828,7 +20068,7 @@ function createPortal(children, container) {
19828
20068
  }
19829
20069
 
19830
20070
  var ReactDOM = {
19831
- createPortal: createPortal,
20071
+ createPortal: createPortal$$1,
19832
20072
 
19833
20073
  findDOMNode: function (componentOrElement) {
19834
20074
  {
@@ -19903,7 +20143,7 @@ var ReactDOM = {
19903
20143
  didWarnAboutUnstableCreatePortal = true;
19904
20144
  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.');
19905
20145
  }
19906
- return createPortal.apply(undefined, arguments);
20146
+ return createPortal$$1.apply(undefined, arguments);
19907
20147
  },
19908
20148
 
19909
20149
 
@@ -19913,6 +20153,7 @@ var ReactDOM = {
19913
20153
 
19914
20154
  flushSync: flushSync,
19915
20155
 
20156
+ unstable_createRoot: createRoot,
19916
20157
  unstable_flushControlled: flushControlled,
19917
20158
 
19918
20159
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
@@ -19931,8 +20172,7 @@ function createRoot(container, options) {
19931
20172
 
19932
20173
  if (enableStableConcurrentModeAPIs) {
19933
20174
  ReactDOM.createRoot = createRoot;
19934
- } else {
19935
- ReactDOM.unstable_createRoot = createRoot;
20175
+ ReactDOM.unstable_createRoot = undefined;
19936
20176
  }
19937
20177
 
19938
20178
  var foundDevTools = injectIntoDevTools({