react-test-renderer 16.13.0 → 16.13.1

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.
package/build-info.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "branch": "master",
3
- "buildNumber": "91354",
4
- "checksum": "b0ed8f5",
5
- "commit": "d28bd2994",
2
+ "branch": "pull/18344",
3
+ "buildNumber": "106499",
4
+ "checksum": "7fe5a2e",
5
+ "commit": "da834083c",
6
6
  "environment": "ci",
7
- "reactVersion": "16.12.0-d28bd2994"
7
+ "reactVersion": "16.12.0-da834083c"
8
8
  }
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer-shallow.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer-shallow.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -887,7 +887,7 @@ function getStackByFiberInDevAndProd(workInProgress) {
887
887
  return info;
888
888
  }
889
889
  var current = null;
890
- var phase = null;
890
+ var isRendering = false;
891
891
  function getCurrentFiberOwnerNameInDevOrNull() {
892
892
  {
893
893
  if (current === null) {
@@ -918,19 +918,19 @@ function resetCurrentFiber() {
918
918
  {
919
919
  ReactDebugCurrentFrame.getCurrentStack = null;
920
920
  current = null;
921
- phase = null;
921
+ isRendering = false;
922
922
  }
923
923
  }
924
924
  function setCurrentFiber(fiber) {
925
925
  {
926
926
  ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
927
927
  current = fiber;
928
- phase = null;
928
+ isRendering = false;
929
929
  }
930
930
  }
931
- function setCurrentPhase(lifeCyclePhase) {
931
+ function setIsRendering(rendering) {
932
932
  {
933
- phase = lifeCyclePhase;
933
+ isRendering = rendering;
934
934
  }
935
935
  }
936
936
 
@@ -1548,19 +1548,10 @@ function processChildContext(fiber, type, parentContext) {
1548
1548
  }
1549
1549
 
1550
1550
  var childContext;
1551
-
1552
- {
1553
- setCurrentPhase('getChildContext');
1554
- }
1555
-
1556
1551
  startPhaseTimer(fiber, 'getChildContext');
1557
1552
  childContext = instance.getChildContext();
1558
1553
  stopPhaseTimer();
1559
1554
 
1560
- {
1561
- setCurrentPhase(null);
1562
- }
1563
-
1564
1555
  for (var contextKey in childContext) {
1565
1556
  if (!(contextKey in childContextTypes)) {
1566
1557
  {
@@ -7220,7 +7211,6 @@ var didWarnAboutContextTypeOnFunctionComponent;
7220
7211
  var didWarnAboutGetDerivedStateOnFunctionComponent;
7221
7212
  var didWarnAboutFunctionRefs;
7222
7213
  var didWarnAboutReassigningProps;
7223
- var didWarnAboutMaxDuration;
7224
7214
  var didWarnAboutRevealOrder;
7225
7215
  var didWarnAboutTailOptions;
7226
7216
 
@@ -7231,7 +7221,6 @@ var didWarnAboutTailOptions;
7231
7221
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
7232
7222
  didWarnAboutFunctionRefs = {};
7233
7223
  didWarnAboutReassigningProps = false;
7234
- didWarnAboutMaxDuration = false;
7235
7224
  didWarnAboutRevealOrder = {};
7236
7225
  didWarnAboutTailOptions = {};
7237
7226
  }
@@ -7295,10 +7284,10 @@ function updateForwardRef(current, workInProgress, Component, nextProps, renderE
7295
7284
 
7296
7285
  {
7297
7286
  ReactCurrentOwner$1.current = workInProgress;
7298
- setCurrentPhase('render');
7287
+ setIsRendering(true);
7299
7288
  nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
7300
7289
 
7301
- setCurrentPhase(null);
7290
+ setIsRendering(false);
7302
7291
  }
7303
7292
 
7304
7293
  if (current !== null && !didReceiveUpdate) {
@@ -7506,10 +7495,10 @@ function updateFunctionComponent(current, workInProgress, Component, nextProps,
7506
7495
 
7507
7496
  {
7508
7497
  ReactCurrentOwner$1.current = workInProgress;
7509
- setCurrentPhase('render');
7498
+ setIsRendering(true);
7510
7499
  nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
7511
7500
 
7512
- setCurrentPhase(null);
7501
+ setIsRendering(false);
7513
7502
  }
7514
7503
 
7515
7504
  if (current !== null && !didReceiveUpdate) {
@@ -7625,10 +7614,10 @@ function finishClassComponent(current, workInProgress, Component, shouldUpdate,
7625
7614
  }
7626
7615
  } else {
7627
7616
  {
7628
- setCurrentPhase('render');
7617
+ setIsRendering(true);
7629
7618
  nextChildren = instance.render();
7630
7619
 
7631
- setCurrentPhase(null);
7620
+ setIsRendering(false);
7632
7621
  }
7633
7622
  } // React DevTools reads this flag.
7634
7623
 
@@ -7924,8 +7913,10 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render
7924
7913
  ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
7925
7914
  }
7926
7915
 
7916
+ setIsRendering(true);
7927
7917
  ReactCurrentOwner$1.current = workInProgress;
7928
7918
  value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
7919
+ setIsRendering(false);
7929
7920
  } // React DevTools reads this flag.
7930
7921
 
7931
7922
 
@@ -8081,17 +8072,7 @@ function updateSuspenseComponent(current, workInProgress, renderExpirationTime)
8081
8072
  }
8082
8073
 
8083
8074
  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
8084
- pushSuspenseContext(workInProgress, suspenseContext);
8085
-
8086
- {
8087
- if ('maxDuration' in nextProps) {
8088
- if (!didWarnAboutMaxDuration) {
8089
- didWarnAboutMaxDuration = true;
8090
-
8091
- error('maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
8092
- }
8093
- }
8094
- } // This next part is a bit confusing. If the children timeout, we switch to
8075
+ pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to
8095
8076
  // showing the fallback children in place of the "primary" children.
8096
8077
  // However, we don't want to delete the primary children because then their
8097
8078
  // state will be lost (both the React state and the host state, e.g.
@@ -8113,7 +8094,6 @@ function updateSuspenseComponent(current, workInProgress, renderExpirationTime)
8113
8094
  // custom reconciliation logic to preserve the state of the primary
8114
8095
  // children. It's essentially a very basic form of re-parenting.
8115
8096
 
8116
-
8117
8097
  if (current === null) {
8118
8098
  // If we're currently hydrating, try to hydrate this boundary.
8119
8099
  // But only if this has a fallback.
@@ -8744,9 +8724,9 @@ function updateContextConsumer(current, workInProgress, renderExpirationTime) {
8744
8724
 
8745
8725
  {
8746
8726
  ReactCurrentOwner$1.current = workInProgress;
8747
- setCurrentPhase('render');
8727
+ setIsRendering(true);
8748
8728
  newChildren = render(newValue);
8749
- setCurrentPhase(null);
8729
+ setIsRendering(false);
8750
8730
  } // React DevTools reads this flag.
8751
8731
 
8752
8732
 
@@ -11414,9 +11394,11 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
11414
11394
  var currentSource = sourceFiber.alternate;
11415
11395
 
11416
11396
  if (currentSource) {
11397
+ sourceFiber.updateQueue = currentSource.updateQueue;
11417
11398
  sourceFiber.memoizedState = currentSource.memoizedState;
11418
11399
  sourceFiber.expirationTime = currentSource.expirationTime;
11419
11400
  } else {
11401
+ sourceFiber.updateQueue = null;
11420
11402
  sourceFiber.memoizedState = null;
11421
11403
  }
11422
11404
  }
@@ -13679,43 +13661,40 @@ var beginWork$1;
13679
13661
  }
13680
13662
 
13681
13663
  var didWarnAboutUpdateInRender = false;
13682
- var didWarnAboutUpdateInGetChildContext = false;
13664
+ var didWarnAboutUpdateInRenderForAnotherComponent;
13665
+
13666
+ {
13667
+ didWarnAboutUpdateInRenderForAnotherComponent = new Set();
13668
+ }
13683
13669
 
13684
13670
  function warnAboutRenderPhaseUpdatesInDEV(fiber) {
13685
13671
  {
13686
- if ((executionContext & RenderContext) !== NoContext) {
13672
+ if (isRendering && (executionContext & RenderContext) !== NoContext) {
13687
13673
  switch (fiber.tag) {
13688
13674
  case FunctionComponent:
13689
13675
  case ForwardRef:
13690
13676
  case SimpleMemoComponent:
13691
13677
  {
13692
- error('Cannot update a component from inside the function body of a ' + 'different component.');
13678
+ var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.
13679
+
13680
+ var dedupeKey = renderingComponentName;
13681
+
13682
+ if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
13683
+ didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
13684
+ var setStateComponentName = getComponentName(fiber.type) || 'Unknown';
13685
+
13686
+ error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
13687
+ }
13693
13688
 
13694
13689
  break;
13695
13690
  }
13696
13691
 
13697
13692
  case ClassComponent:
13698
13693
  {
13699
- switch (phase) {
13700
- case 'getChildContext':
13701
- if (didWarnAboutUpdateInGetChildContext) {
13702
- return;
13703
- }
13694
+ if (!didWarnAboutUpdateInRender) {
13695
+ error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
13704
13696
 
13705
- error('setState(...): Cannot call setState() inside getChildContext()');
13706
-
13707
- didWarnAboutUpdateInGetChildContext = true;
13708
- break;
13709
-
13710
- case 'render':
13711
- if (didWarnAboutUpdateInRender) {
13712
- return;
13713
- }
13714
-
13715
- error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
13716
-
13717
- didWarnAboutUpdateInRender = true;
13718
- break;
13697
+ didWarnAboutUpdateInRender = true;
13719
13698
  }
13720
13699
 
13721
13700
  break;
@@ -14739,7 +14718,7 @@ function updateContainer(element, container, parentComponent, callback) {
14739
14718
  }
14740
14719
 
14741
14720
  {
14742
- if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
14721
+ if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
14743
14722
  didWarnAboutNestedUpdates = true;
14744
14723
 
14745
14724
  error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
@@ -15041,7 +15020,7 @@ function act(callback) {
15041
15020
  }
15042
15021
  }
15043
15022
 
15044
- var ReactVersion = '16.13.0';
15023
+ var ReactVersion = '16.13.1';
15045
15024
 
15046
15025
  var defaultTestOptions = {
15047
15026
  createNodeMock: function () {
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -126,11 +126,11 @@ e||e>=c)){a.lastPingedTime=c;He(a,c);break}e=De(a);if(0!==e&&e!==c)break;if(0!==
126
126
  g.busyDelayMs|0,f=G()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10<d){Ad(a,c);a.timeoutHandle=Ia(Me.bind(null,a),d);break}}Me(a);break;default:throw Error(n(329));}Z(a);if(a.callbackNode===b)return Fe.bind(null,a)}}return null}
127
127
  function Ce(a){var b=a.lastExpiredTime;b=0!==b?b:1073741823;if((W&(je|ke))!==V)throw Error(n(327));Ge();a===T&&b===U||He(a,b);if(null!==X){var c=W;W|=je;var d=Ie();do try{Ne();break}catch(e){Ke(a,e)}while(1);Cb();W=c;ge.current=d;if(S===le)throw c=oe,He(a,b),Ad(a,b),Z(a),c;if(null!==X)throw Error(n(261));a.finishedWork=a.current.alternate;a.finishedExpirationTime=b;T=null;Me(a);Z(a)}return null}function Oe(a,b){var c=W;W|=1;try{return a(b)}finally{W=c,W===V&&tb()}}
128
128
  function He(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Ja(c));if(null!==X)for(c=X.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&Ra();break;case 3:sc();B(E);B(D);break;case 5:uc(d);break;case 4:sc();break;case 13:B(K);break;case 19:B(K);break;case 10:Db(d)}c=c.return}T=a;X=ec(a.current,null);U=b;S=wd;oe=null;qe=pe=1073741823;re=null;zd=0;se=!1}
129
- function Ke(a,b){do{try{Cb();xc.current=Fc;if(zc)for(var c=M.memoizedState;null!==c;){var d=c.queue;null!==d&&(d.pending=null);c=c.next}yc=0;O=N=M=null;zc=!1;if(null===X||null===X.return)return S=le,oe=b,X=null;a:{var e=a,f=X.return,g=X,h=b;b=U;g.effectTag|=2048;g.firstEffect=g.lastEffect=null;if(null!==h&&"object"===typeof h&&"function"===typeof h.then){var k=h;if(0===(g.mode&2)){var l=g.alternate;l?(g.memoizedState=l.memoizedState,g.expirationTime=l.expirationTime):g.memoizedState=null}var p=0!==
130
- (K.current&1),q=f;do{var v;if(v=13===q.tag){var x=q.memoizedState;if(null!==x)v=null!==x.dehydrated?!0:!1;else{var P=q.memoizedProps;v=void 0===P.fallback?!1:!0!==P.unstable_avoidThisFallback?!0:p?!1:!0}}if(v){var z=q.updateQueue;if(null===z){var A=new Set;A.add(k);q.updateQueue=A}else z.add(k);if(0===(q.mode&2)){q.effectTag|=64;g.effectTag&=-2981;if(1===g.tag)if(null===g.alternate)g.tag=17;else{var u=Jb(1073741823,null);u.tag=2;Kb(g,u)}g.expirationTime=1073741823;break a}h=void 0;g=b;var r=e.pingCache;
131
- null===r?(r=e.pingCache=new $d,h=new Set,r.set(k,h)):(h=r.get(k),void 0===h&&(h=new Set,r.set(k,h)));if(!h.has(g)){h.add(g);var Ld=Pe.bind(null,e,k,g);k.then(Ld,Ld)}q.effectTag|=4096;q.expirationTime=b;break a}q=q.return}while(null!==q);h=Error((xa(g.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+La(g))}S!==ne&&(S=me);h=Dd(h,g);q=f;do{switch(q.tag){case 3:k=
132
- h;q.effectTag|=4096;q.expirationTime=b;var $e=ae(q,k,b);Lb(q,$e);break a;case 1:k=h;var af=q.type,oc=q.stateNode;if(0===(q.effectTag&64)&&("function"===typeof af.getDerivedStateFromError||null!==oc&&"function"===typeof oc.componentDidCatch&&(null===ee||!ee.has(oc)))){q.effectTag|=4096;q.expirationTime=b;var bf=de(q,k,b);Lb(q,bf);break a}}q=q.return}while(null!==q)}X=Qe(X)}catch(cf){b=cf;continue}break}while(1)}function Ie(){var a=ge.current;ge.current=Fc;return null===a?Fc:a}
133
- function Nb(a,b){a<pe&&2<a&&(pe=a);null!==b&&a<qe&&2<a&&(qe=a,re=b)}function Ob(a){a>zd&&(zd=a)}function Ne(){for(;null!==X;)X=Re(X)}function Je(){for(;null!==X&&!hb();)X=Re(X)}function Re(a){var b=Se(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Qe(a));he.current=null;return b}
129
+ function Ke(a,b){do{try{Cb();xc.current=Fc;if(zc)for(var c=M.memoizedState;null!==c;){var d=c.queue;null!==d&&(d.pending=null);c=c.next}yc=0;O=N=M=null;zc=!1;if(null===X||null===X.return)return S=le,oe=b,X=null;a:{var e=a,f=X.return,g=X,h=b;b=U;g.effectTag|=2048;g.firstEffect=g.lastEffect=null;if(null!==h&&"object"===typeof h&&"function"===typeof h.then){var k=h;if(0===(g.mode&2)){var l=g.alternate;l?(g.updateQueue=l.updateQueue,g.memoizedState=l.memoizedState,g.expirationTime=l.expirationTime):(g.updateQueue=
130
+ null,g.memoizedState=null)}var p=0!==(K.current&1),q=f;do{var v;if(v=13===q.tag){var x=q.memoizedState;if(null!==x)v=null!==x.dehydrated?!0:!1;else{var P=q.memoizedProps;v=void 0===P.fallback?!1:!0!==P.unstable_avoidThisFallback?!0:p?!1:!0}}if(v){var z=q.updateQueue;if(null===z){var A=new Set;A.add(k);q.updateQueue=A}else z.add(k);if(0===(q.mode&2)){q.effectTag|=64;g.effectTag&=-2981;if(1===g.tag)if(null===g.alternate)g.tag=17;else{var u=Jb(1073741823,null);u.tag=2;Kb(g,u)}g.expirationTime=1073741823;
131
+ break a}h=void 0;g=b;var r=e.pingCache;null===r?(r=e.pingCache=new $d,h=new Set,r.set(k,h)):(h=r.get(k),void 0===h&&(h=new Set,r.set(k,h)));if(!h.has(g)){h.add(g);var Ld=Pe.bind(null,e,k,g);k.then(Ld,Ld)}q.effectTag|=4096;q.expirationTime=b;break a}q=q.return}while(null!==q);h=Error((xa(g.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+
132
+ La(g))}S!==ne&&(S=me);h=Dd(h,g);q=f;do{switch(q.tag){case 3:k=h;q.effectTag|=4096;q.expirationTime=b;var $e=ae(q,k,b);Lb(q,$e);break a;case 1:k=h;var af=q.type,oc=q.stateNode;if(0===(q.effectTag&64)&&("function"===typeof af.getDerivedStateFromError||null!==oc&&"function"===typeof oc.componentDidCatch&&(null===ee||!ee.has(oc)))){q.effectTag|=4096;q.expirationTime=b;var bf=de(q,k,b);Lb(q,bf);break a}}q=q.return}while(null!==q)}X=Qe(X)}catch(cf){b=cf;continue}break}while(1)}
133
+ function Ie(){var a=ge.current;ge.current=Fc;return null===a?Fc:a}function Nb(a,b){a<pe&&2<a&&(pe=a);null!==b&&a<qe&&2<a&&(qe=a,re=b)}function Ob(a){a>zd&&(zd=a)}function Ne(){for(;null!==X;)X=Re(X)}function Je(){for(;null!==X&&!hb();)X=Re(X)}function Re(a){var b=Se(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=Qe(a));he.current=null;return b}
134
134
  function Qe(a){X=a;do{var b=X.alternate;a=X.return;if(0===(X.effectTag&2048)){b=vd(b,X,U);if(1===U||1!==X.childExpirationTime){for(var c=0,d=X.child;null!==d;){var e=d.expirationTime,f=d.childExpirationTime;e>c&&(c=e);f>c&&(c=f);d=d.sibling}X.childExpirationTime=c}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=X.firstEffect),null!==X.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=X.firstEffect),a.lastEffect=X.lastEffect),1<X.effectTag&&(null!==
135
135
  a.lastEffect?a.lastEffect.nextEffect=X:a.firstEffect=X,a.lastEffect=X))}else{b=Cd(X);if(null!==b)return b.effectTag&=2047,b;null!==a&&(a.firstEffect=a.lastEffect=null,a.effectTag|=2048)}b=X.sibling;if(null!==b)return b;X=a}while(null!==X);S===wd&&(S=ne);return null}function Le(a){var b=a.expirationTime;a=a.childExpirationTime;return b>a?b:a}function Me(a){var b=nb();pb(99,Te.bind(null,a,b));return null}
136
136
  function Te(a,b){do Ge();while(null!==ve);if((W&(je|ke))!==V)throw Error(n(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(n(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Le(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=
@@ -178,4 +178,4 @@ a:{var a=f.current;if(a.child)switch(a.child.tag){case 5:a=Fa(a.child.stateNode)
178
178
  return 1===a.length?a[0]:yf(f.current)}});return a},unstable_batchedUpdates:Oe,act:function(a){function b(){of--;kf.current=c}!1===pf&&(pf=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected."));of++;var c=kf.current;kf.current=!0;try{var d=Oe(a)}catch(e){throw b(),e;}if(null!==d&&"object"===typeof d&&"function"===typeof d.then)return{then:function(a,f){d.then(function(){1<of||!0===lf&&!0===c?(b(),a()):nf(function(c){b();c?f(c):a()})},function(a){b();
179
179
  f(a)})}};try{1!==of||!1!==lf&&!1!==c||mf(),b()}catch(e){throw b(),e;}return{then:function(a){a()}}}},Df=new WeakMap;function yf(a){var b=Df.get(a);void 0===b&&null!==a.alternate&&(b=Df.get(a.alternate));void 0===b&&(b=new Bf(a),Df.set(a,b));return b}
180
180
  (function(a){var b=a.findFiberByHostInstance;return Ze(aa({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:t.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=Ba(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");
181
- },bundleType:0,version:"16.13.0",rendererPackageName:"react-test-renderer"});module.exports=Cf.default||Cf;
181
+ },bundleType:0,version:"16.13.1",rendererPackageName:"react-test-renderer"});module.exports=Cf.default||Cf;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-test-renderer",
3
- "version": "16.13.0",
3
+ "version": "16.13.1",
4
4
  "description": "React package for snapshot testing.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -22,10 +22,10 @@
22
22
  "object-assign": "^4.1.1",
23
23
  "prop-types": "^15.6.2",
24
24
  "react-is": "^16.8.6",
25
- "scheduler": "^0.19.0"
25
+ "scheduler": "^0.19.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "react": "^16.0.0"
28
+ "react": "^16.13.1"
29
29
  },
30
30
  "files": [
31
31
  "LICENSE",
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer-shallow.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer-shallow.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1,4 +1,4 @@
1
- /** @license React v16.13.0
1
+ /** @license React v16.13.1
2
2
  * react-test-renderer.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -988,7 +988,7 @@
988
988
  return info;
989
989
  }
990
990
  var current = null;
991
- var phase = null;
991
+ var isRendering = false;
992
992
  function getCurrentFiberOwnerNameInDevOrNull() {
993
993
  {
994
994
  if (current === null) {
@@ -1019,19 +1019,19 @@
1019
1019
  {
1020
1020
  ReactDebugCurrentFrame.getCurrentStack = null;
1021
1021
  current = null;
1022
- phase = null;
1022
+ isRendering = false;
1023
1023
  }
1024
1024
  }
1025
1025
  function setCurrentFiber(fiber) {
1026
1026
  {
1027
1027
  ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
1028
1028
  current = fiber;
1029
- phase = null;
1029
+ isRendering = false;
1030
1030
  }
1031
1031
  }
1032
- function setCurrentPhase(lifeCyclePhase) {
1032
+ function setIsRendering(rendering) {
1033
1033
  {
1034
- phase = lifeCyclePhase;
1034
+ isRendering = rendering;
1035
1035
  }
1036
1036
  }
1037
1037
 
@@ -1649,19 +1649,10 @@
1649
1649
  }
1650
1650
 
1651
1651
  var childContext;
1652
-
1653
- {
1654
- setCurrentPhase('getChildContext');
1655
- }
1656
-
1657
1652
  startPhaseTimer(fiber, 'getChildContext');
1658
1653
  childContext = instance.getChildContext();
1659
1654
  stopPhaseTimer();
1660
1655
 
1661
- {
1662
- setCurrentPhase(null);
1663
- }
1664
-
1665
1656
  for (var contextKey in childContext) {
1666
1657
  if (!(contextKey in childContextTypes)) {
1667
1658
  {
@@ -7333,7 +7324,6 @@
7333
7324
  var didWarnAboutGetDerivedStateOnFunctionComponent;
7334
7325
  var didWarnAboutFunctionRefs;
7335
7326
  var didWarnAboutReassigningProps;
7336
- var didWarnAboutMaxDuration;
7337
7327
  var didWarnAboutRevealOrder;
7338
7328
  var didWarnAboutTailOptions;
7339
7329
 
@@ -7344,7 +7334,6 @@
7344
7334
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
7345
7335
  didWarnAboutFunctionRefs = {};
7346
7336
  didWarnAboutReassigningProps = false;
7347
- didWarnAboutMaxDuration = false;
7348
7337
  didWarnAboutRevealOrder = {};
7349
7338
  didWarnAboutTailOptions = {};
7350
7339
  }
@@ -7408,10 +7397,10 @@
7408
7397
 
7409
7398
  {
7410
7399
  ReactCurrentOwner$1.current = workInProgress;
7411
- setCurrentPhase('render');
7400
+ setIsRendering(true);
7412
7401
  nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
7413
7402
 
7414
- setCurrentPhase(null);
7403
+ setIsRendering(false);
7415
7404
  }
7416
7405
 
7417
7406
  if (current !== null && !didReceiveUpdate) {
@@ -7619,10 +7608,10 @@
7619
7608
 
7620
7609
  {
7621
7610
  ReactCurrentOwner$1.current = workInProgress;
7622
- setCurrentPhase('render');
7611
+ setIsRendering(true);
7623
7612
  nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
7624
7613
 
7625
- setCurrentPhase(null);
7614
+ setIsRendering(false);
7626
7615
  }
7627
7616
 
7628
7617
  if (current !== null && !didReceiveUpdate) {
@@ -7738,10 +7727,10 @@
7738
7727
  }
7739
7728
  } else {
7740
7729
  {
7741
- setCurrentPhase('render');
7730
+ setIsRendering(true);
7742
7731
  nextChildren = instance.render();
7743
7732
 
7744
- setCurrentPhase(null);
7733
+ setIsRendering(false);
7745
7734
  }
7746
7735
  } // React DevTools reads this flag.
7747
7736
 
@@ -8037,8 +8026,10 @@
8037
8026
  ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
8038
8027
  }
8039
8028
 
8029
+ setIsRendering(true);
8040
8030
  ReactCurrentOwner$1.current = workInProgress;
8041
8031
  value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
8032
+ setIsRendering(false);
8042
8033
  } // React DevTools reads this flag.
8043
8034
 
8044
8035
 
@@ -8194,17 +8185,7 @@
8194
8185
  }
8195
8186
 
8196
8187
  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
8197
- pushSuspenseContext(workInProgress, suspenseContext);
8198
-
8199
- {
8200
- if ('maxDuration' in nextProps) {
8201
- if (!didWarnAboutMaxDuration) {
8202
- didWarnAboutMaxDuration = true;
8203
-
8204
- error('maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
8205
- }
8206
- }
8207
- } // This next part is a bit confusing. If the children timeout, we switch to
8188
+ pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to
8208
8189
  // showing the fallback children in place of the "primary" children.
8209
8190
  // However, we don't want to delete the primary children because then their
8210
8191
  // state will be lost (both the React state and the host state, e.g.
@@ -8226,7 +8207,6 @@
8226
8207
  // custom reconciliation logic to preserve the state of the primary
8227
8208
  // children. It's essentially a very basic form of re-parenting.
8228
8209
 
8229
-
8230
8210
  if (current === null) {
8231
8211
  // If we're currently hydrating, try to hydrate this boundary.
8232
8212
  // But only if this has a fallback.
@@ -8857,9 +8837,9 @@
8857
8837
 
8858
8838
  {
8859
8839
  ReactCurrentOwner$1.current = workInProgress;
8860
- setCurrentPhase('render');
8840
+ setIsRendering(true);
8861
8841
  newChildren = render(newValue);
8862
- setCurrentPhase(null);
8842
+ setIsRendering(false);
8863
8843
  } // React DevTools reads this flag.
8864
8844
 
8865
8845
 
@@ -11527,9 +11507,11 @@
11527
11507
  var currentSource = sourceFiber.alternate;
11528
11508
 
11529
11509
  if (currentSource) {
11510
+ sourceFiber.updateQueue = currentSource.updateQueue;
11530
11511
  sourceFiber.memoizedState = currentSource.memoizedState;
11531
11512
  sourceFiber.expirationTime = currentSource.expirationTime;
11532
11513
  } else {
11514
+ sourceFiber.updateQueue = null;
11533
11515
  sourceFiber.memoizedState = null;
11534
11516
  }
11535
11517
  }
@@ -13792,43 +13774,40 @@
13792
13774
  }
13793
13775
 
13794
13776
  var didWarnAboutUpdateInRender = false;
13795
- var didWarnAboutUpdateInGetChildContext = false;
13777
+ var didWarnAboutUpdateInRenderForAnotherComponent;
13778
+
13779
+ {
13780
+ didWarnAboutUpdateInRenderForAnotherComponent = new Set();
13781
+ }
13796
13782
 
13797
13783
  function warnAboutRenderPhaseUpdatesInDEV(fiber) {
13798
13784
  {
13799
- if ((executionContext & RenderContext) !== NoContext) {
13785
+ if (isRendering && (executionContext & RenderContext) !== NoContext) {
13800
13786
  switch (fiber.tag) {
13801
13787
  case FunctionComponent:
13802
13788
  case ForwardRef:
13803
13789
  case SimpleMemoComponent:
13804
13790
  {
13805
- error('Cannot update a component from inside the function body of a ' + 'different component.');
13791
+ var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed.
13792
+
13793
+ var dedupeKey = renderingComponentName;
13794
+
13795
+ if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
13796
+ didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
13797
+ var setStateComponentName = getComponentName(fiber.type) || 'Unknown';
13798
+
13799
+ error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);
13800
+ }
13806
13801
 
13807
13802
  break;
13808
13803
  }
13809
13804
 
13810
13805
  case ClassComponent:
13811
13806
  {
13812
- switch (phase) {
13813
- case 'getChildContext':
13814
- if (didWarnAboutUpdateInGetChildContext) {
13815
- return;
13816
- }
13807
+ if (!didWarnAboutUpdateInRender) {
13808
+ error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
13817
13809
 
13818
- error('setState(...): Cannot call setState() inside getChildContext()');
13819
-
13820
- didWarnAboutUpdateInGetChildContext = true;
13821
- break;
13822
-
13823
- case 'render':
13824
- if (didWarnAboutUpdateInRender) {
13825
- return;
13826
- }
13827
-
13828
- error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
13829
-
13830
- didWarnAboutUpdateInRender = true;
13831
- break;
13810
+ didWarnAboutUpdateInRender = true;
13832
13811
  }
13833
13812
 
13834
13813
  break;
@@ -14852,7 +14831,7 @@
14852
14831
  }
14853
14832
 
14854
14833
  {
14855
- if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
14834
+ if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
14856
14835
  didWarnAboutNestedUpdates = true;
14857
14836
 
14858
14837
  error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
@@ -15154,7 +15133,7 @@
15154
15133
  }
15155
15134
  }
15156
15135
 
15157
- var ReactVersion = '16.13.0';
15136
+ var ReactVersion = '16.13.1';
15158
15137
 
15159
15138
  var defaultTestOptions = {
15160
15139
  createNodeMock: function () {