react-test-renderer 16.8.2 → 16.8.6
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 +6 -6
- package/cjs/react-test-renderer-shallow.development.js +120 -83
- package/cjs/react-test-renderer-shallow.production.min.js +24 -23
- package/cjs/react-test-renderer.development.js +266 -85
- package/cjs/react-test-renderer.production.min.js +9 -9
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +126 -84
- package/umd/react-test-renderer-shallow.production.min.js +24 -23
- package/umd/react-test-renderer.development.js +266 -85
- package/umd/react-test-renderer.production.min.js +93 -93
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.6
|
|
2
2
|
* react-test-renderer.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -54,19 +54,19 @@ for(var m=k=null,q=g,u=g=0,y=null,r=h.next();null!==q&&!r.done;u++,r=h.next()){q
|
|
|
54
54
|
r.key),g=f(r,g,u),null===m?k=r:m.sibling=r,m=r);a&&q.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ha&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case ea:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===ha:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ha?f.props.children:f.props,h);d.ref=Lb(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=
|
|
55
55
|
k.sibling}f.type===ha?(d=gb(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=fb(f.type,f.key,f.props,null,a.mode,h),h.ref=Lb(a,d,f),h.return=a,a=h)}return g(a);case fa:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=jb(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=
|
|
56
56
|
""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=ib(f,a.mode,h),d.return=a,a=d),g(a);if(Kb(f))return t(a,d,f,h);if(sa(f))return xa(a,d,f,h);l&&Mb(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,p("152",h.displayName||h.name||"Component")}return c(a,d)}}var Ob=Nb(!0),Pb=Nb(!1),Qb={},K={current:Qb},Rb={current:Qb},Sb={current:Qb};function Tb(a){a===Qb?p("174"):void 0;return a}function Ub(a,b){D(Sb,b,a);D(Rb,a,a);D(K,Qb,a);C(K,a);D(K,Fa,a)}
|
|
57
|
-
function Vb(a){C(K,a);C(Rb,a);C(Sb,a)}function Wb(a){Tb(Sb.current);Tb(K.current)!==Fa&&(D(Rb,a,a),D(K,Fa,a))}function Xb(a){Rb.current===a&&(C(K,a),C(Rb,a))}var Yb=0,Zb=2,$b=4,ac=8,bc=16,cc=32,dc=64,ec=128,fc=da.ReactCurrentDispatcher,gc=0,hc=null,L=null,M=null,ic=null,N=null,jc=null,kc=0,O=null,lc=0,mc=!1,nc=null,oc=0;function P(){p("
|
|
57
|
+
function Vb(a){C(K,a);C(Rb,a);C(Sb,a)}function Wb(a){Tb(Sb.current);Tb(K.current)!==Fa&&(D(Rb,a,a),D(K,Fa,a))}function Xb(a){Rb.current===a&&(C(K,a),C(Rb,a))}var Yb=0,Zb=2,$b=4,ac=8,bc=16,cc=32,dc=64,ec=128,fc=da.ReactCurrentDispatcher,gc=0,hc=null,L=null,M=null,ic=null,N=null,jc=null,kc=0,O=null,lc=0,mc=!1,nc=null,oc=0;function P(){p("321")}function pc(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!qb(a[c],b[c]))return!1;return!0}
|
|
58
58
|
function qc(a,b,c,d,e,f){gc=f;hc=b;M=null!==a?a.memoizedState:null;fc.current=null===M?rc:sc;b=c(d,e);if(mc){do mc=!1,oc+=1,M=null!==a?a.memoizedState:null,jc=ic,O=N=L=null,fc.current=sc,b=c(d,e);while(mc);nc=null;oc=0}fc.current=tc;a=hc;a.memoizedState=ic;a.expirationTime=kc;a.updateQueue=O;a.effectTag|=lc;a=null!==L&&null!==L.next;gc=0;jc=N=ic=M=L=hc=null;kc=0;O=null;lc=0;a?p("300"):void 0;return b}function uc(){fc.current=tc;gc=0;jc=N=ic=M=L=hc=null;kc=0;O=null;lc=0;mc=!1;nc=null;oc=0}
|
|
59
59
|
function vc(){var a={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};null===N?ic=N=a:N=N.next=a;return N}function wc(){if(null!==jc)N=jc,jc=N.next,L=M,M=null!==L?L.next:null;else{null===M?p("310"):void 0;L=M;var a={memoizedState:L.memoizedState,baseState:L.baseState,queue:L.queue,baseUpdate:L.baseUpdate,next:null};N=null===N?ic=a:N.next=a;M=L.next}return N}function xc(a,b){return"function"===typeof b?b(a):b}
|
|
60
|
-
function yc(a){var b=wc(),c=b.queue;null===c?p("311"):void 0;if(0<oc){var d=c.dispatch;if(null!==nc){var e=nc.get(c);if(void 0!==e){nc.delete(c);var f=b.memoizedState;do f=a(f,e.action),e=e.next;while(null!==e);qb(f,b.memoizedState)||(zc=!0);b.memoizedState=f;b.baseUpdate===c.last&&(b.baseState=f);return[f,d]}}return[b.memoizedState,d]}d=c.last;var g=b.baseUpdate;f=b.baseState;null!==g?(null!==d&&(d.next=null),d=g.next):d=null!==d?d.next:null;if(null!==
|
|
61
|
-
m<gc?(k||(k=!0,h=g,e=f),m>kc&&(kc=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next}while(null!==l&&l!==d);k||(h=g,e=f);qb(f,b.memoizedState)||(zc=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.
|
|
60
|
+
function yc(a){var b=wc(),c=b.queue;null===c?p("311"):void 0;c.lastRenderedReducer=a;if(0<oc){var d=c.dispatch;if(null!==nc){var e=nc.get(c);if(void 0!==e){nc.delete(c);var f=b.memoizedState;do f=a(f,e.action),e=e.next;while(null!==e);qb(f,b.memoizedState)||(zc=!0);b.memoizedState=f;b.baseUpdate===c.last&&(b.baseState=f);c.lastRenderedState=f;return[f,d]}}return[b.memoizedState,d]}d=c.last;var g=b.baseUpdate;f=b.baseState;null!==g?(null!==d&&(d.next=null),d=g.next):d=null!==d?d.next:null;if(null!==
|
|
61
|
+
d){var h=e=null,l=d,k=!1;do{var m=l.expirationTime;m<gc?(k||(k=!0,h=g,e=f),m>kc&&(kc=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next}while(null!==l&&l!==d);k||(h=g,e=f);qb(f,b.memoizedState)||(zc=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}
|
|
62
62
|
function Ac(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===O?(O={lastEffect:null},O.lastEffect=a.next=a):(b=O.lastEffect,null===b?O.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,O.lastEffect=a));return a}function Bc(a,b,c,d){var e=vc();lc|=a;e.memoizedState=Ac(b,c,void 0,void 0===d?null:d)}
|
|
63
63
|
function Cc(a,b,c,d){var e=wc();d=void 0===d?null:d;var f=void 0;if(null!==L){var g=L.memoizedState;f=g.destroy;if(null!==d&&pc(d,g.deps)){Ac(Yb,c,f,d);return}}lc|=a;e.memoizedState=Ac(b,c,f,d)}function Dc(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ec(){}
|
|
64
64
|
function Fc(a,b,c){25>oc?void 0:p("301");var d=a.alternate;if(a===hc||null!==d&&d===hc)if(mc=!0,a={expirationTime:gc,action:c,eagerReducer:null,eagerState:null,next:null},null===nc&&(nc=new Map),c=nc.get(b),void 0===c)nc.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{zb();var e=wb();e=xb(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null===
|
|
65
|
-
d||0===d.expirationTime)&&(d=b.
|
|
65
|
+
d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var l=b.lastRenderedState,k=d(l,c);f.eagerReducer=d;f.eagerState=k;if(qb(k,l))return}catch(m){}finally{}Bb(a,e)}}
|
|
66
66
|
var tc={readContext:J,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P},rc={readContext:J,useCallback:function(a,b){vc().memoizedState=[a,void 0===b?null:b];return a},useContext:J,useEffect:function(a,b){return Bc(516,ec|dc,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Bc(4,$b|cc,Dc.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Bc(4,$b|cc,a,b)},useMemo:function(a,
|
|
67
|
-
b){var c=vc();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=vc();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,
|
|
68
|
-
a=a.dispatch=Fc.bind(null,hc,a);return[b.memoizedState,a]},useDebugValue:Ec},sc={readContext:J,useCallback:function(a,b){var c=wc();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&pc(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:J,useEffect:function(a,b){return Cc(516,ec|dc,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Cc(4,$b|cc,Dc.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Cc(4,$b|cc,
|
|
69
|
-
b){var c=wc();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&pc(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:yc,useRef:function(){return wc().memoizedState},useState:function(a){return yc(xc,a)},useDebugValue:Ec},Gc=null,Hc=null,Ic=!1;function Jc(a){switch(a.tag){case 5:return p("305"),a.stateNode=void 0,!0;case 6:return p("305"),a.stateNode=void 0,!0;case 13:return!1;default:return!1}}
|
|
67
|
+
b){var c=vc();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=vc();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Fc.bind(null,hc,a);return[d.memoizedState,a]},useRef:function(a){var b=vc();a={current:a};return b.memoizedState=a},useState:function(a){var b=vc();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null,lastRenderedReducer:xc,
|
|
68
|
+
lastRenderedState:a};a=a.dispatch=Fc.bind(null,hc,a);return[b.memoizedState,a]},useDebugValue:Ec},sc={readContext:J,useCallback:function(a,b){var c=wc();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&pc(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:J,useEffect:function(a,b){return Cc(516,ec|dc,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Cc(4,$b|cc,Dc.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Cc(4,$b|cc,
|
|
69
|
+
a,b)},useMemo:function(a,b){var c=wc();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&pc(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:yc,useRef:function(){return wc().memoizedState},useState:function(a){return yc(xc,a)},useDebugValue:Ec},Gc=null,Hc=null,Ic=!1;function Jc(a){switch(a.tag){case 5:return p("305"),a.stateNode=void 0,!0;case 6:return p("305"),a.stateNode=void 0,!0;case 13:return!1;default:return!1}}
|
|
70
70
|
function Kc(a){if(Ic){var b=Hc;if(b){var c=b;if(!Jc(a,b)){p("305");b=void 0;if(!b||!Jc(a,b)){a.effectTag|=2;Ic=!1;Gc=a;return}b=Gc;var d=H(5,null,null,0);d.elementType="DELETED";d.type="DELETED";d.stateNode=c;d.return=b;d.effectTag=8;null!==b.lastEffect?(b.lastEffect.nextEffect=d,b.lastEffect=d):b.firstEffect=b.lastEffect=d}Gc=a;p("305");Hc=void 0}else a.effectTag|=2,Ic=!1,Gc=a}}var Lc=da.ReactCurrentOwner,zc=!1;function Q(a,b,c,d){b.child=null===a?Pb(b,null,c,d):Ob(b,a.child,c,d)}
|
|
71
71
|
function Mc(a,b,c,d,e){c=c.render;var f=b.ref;Nc(b,e);d=qc(a,b,c,d,f,e);if(null!==a&&!zc)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Oc(a,b,e);b.effectTag|=1;Q(a,b,d,e);return b.child}
|
|
72
72
|
function Pc(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!cb(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Qc(a,b,g,d,e,f);a=fb(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e<f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:sb,c(e,d)&&a.ref===b.ref))return Oc(a,b,f);b.effectTag|=1;a=eb(g,d,f);a.ref=b.ref;a.return=b;return b.child=a}
|
|
@@ -158,5 +158,5 @@ var Ve={create:function(a,b){var c=Ie.createNodeMock,d=!1;"object"===typeof b&&n
|
|
|
158
158
|
!1===e.children[1].isHidden)return Je(e.children[1]);var a=null;if(e.children&&e.children.length)for(var b=0;b<e.children.length;b++){var c=Je(e.children[b]);null!==c&&(null===a?a=[c]:a.push(c))}return a},toTree:function(){return null==f||null==f.current?null:Me(f.current)},update:function(a){null!=f&&null!=f.current&&Ge(a,f,null,null)},unmount:function(){null!=f&&null!=f.current&&(Ge(null,f,null,null),f=e=null)},getInstance:function(){if(null==f||null==f.current)return null;a:{var a=f.current;if(a.child)switch(a.child.tag){case 5:a=
|
|
159
159
|
Ha(a.child.stateNode);break a;default:a=a.child.stateNode}else a=null}return a},unstable_flushAll:Ca,unstable_flushSync:function(a){Ea();a:{V?p("187"):void 0;var b=$d;$d=!0;try{var c=me(a,void 0);break a}finally{$d=b,ae(1073741823,!1)}c=void 0}return c},unstable_flushNumberOfYields:Da,unstable_clearYields:Ea};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===f)throw Error("Can't access .root on unmounted test renderer");var a=Pe(f.current);if(0===a.length)throw Error("Can't access .root on unmounted test renderer");
|
|
160
160
|
return 1===a.length?a[0]:Qe(f.current)}});return a},unstable_yield:function(a){B.push(a)},unstable_clearYields:Ea,unstable_batchedUpdates:Fe,unstable_setNowImplementation:function(a){za=a},act:function(a){Fe(a);Ge(null,Ue,null,null);return{then:function(){}}}},Ue;Ue=kb({children:[],createNodeMock:Ie.createNodeMock,tag:"CONTAINER"},!0,!1);var We=new WeakMap;function Qe(a){var b=We.get(a);void 0===b&&null!==a.alternate&&(b=We.get(a.alternate));void 0===b&&(b=new Te(a),We.set(a,b));return b}
|
|
161
|
-
(function(a){var b=a.findFiberByHostInstance;return ab(aa({},a,{overrideProps:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=ya(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.8.
|
|
161
|
+
(function(a){var b=a.findFiberByHostInstance;return ab(aa({},a,{overrideProps:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=ya(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.8.6",rendererPackageName:"react-test-renderer"});var Xe={default:Ve},Ye=Xe&&Ve||Xe;
|
|
162
162
|
module.exports=Ye.default||Ye;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-test-renderer",
|
|
3
|
-
"version": "16.8.
|
|
3
|
+
"version": "16.8.6",
|
|
4
4
|
"description": "React package for snapshot testing.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"object-assign": "^4.1.1",
|
|
23
23
|
"prop-types": "^15.6.2",
|
|
24
|
-
"react-is": "^16.8.
|
|
25
|
-
"scheduler": "^0.13.
|
|
24
|
+
"react-is": "^16.8.6",
|
|
25
|
+
"scheduler": "^0.13.6"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.6
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -143,7 +143,7 @@ function typeOf(object) {
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
|
|
@@ -162,6 +162,11 @@ function isForwardRef(object) {
|
|
|
162
162
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
|
|
166
|
+
function isMemo(object) {
|
|
167
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
168
|
+
}
|
|
169
|
+
|
|
165
170
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
166
171
|
|
|
167
172
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
@@ -608,6 +613,10 @@ var ReactShallowRenderer = function () {
|
|
|
608
613
|
function ReactShallowRenderer() {
|
|
609
614
|
_classCallCheck(this, ReactShallowRenderer);
|
|
610
615
|
|
|
616
|
+
this._reset();
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
ReactShallowRenderer.prototype._reset = function _reset() {
|
|
611
620
|
this._context = null;
|
|
612
621
|
this._element = null;
|
|
613
622
|
this._instance = null;
|
|
@@ -622,13 +631,11 @@ var ReactShallowRenderer = function () {
|
|
|
622
631
|
this._isReRender = false;
|
|
623
632
|
this._didScheduleRenderPhaseUpdate = false;
|
|
624
633
|
this._renderPhaseUpdates = null;
|
|
625
|
-
this._currentlyRenderingComponent = null;
|
|
626
634
|
this._numberOfReRenders = 0;
|
|
627
|
-
|
|
628
|
-
}
|
|
635
|
+
};
|
|
629
636
|
|
|
630
637
|
ReactShallowRenderer.prototype._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
|
|
631
|
-
!(this.
|
|
638
|
+
!(this._rendering && !this._instance) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0;
|
|
632
639
|
};
|
|
633
640
|
|
|
634
641
|
ReactShallowRenderer.prototype._createDispatcher = function _createDispatcher() {
|
|
@@ -638,32 +645,44 @@ var ReactShallowRenderer = function () {
|
|
|
638
645
|
_this._validateCurrentlyRenderingComponent();
|
|
639
646
|
_this._createWorkInProgressHook();
|
|
640
647
|
var workInProgressHook = _this._workInProgressHook;
|
|
648
|
+
|
|
641
649
|
if (_this._isReRender) {
|
|
642
|
-
// This is a re-render.
|
|
650
|
+
// This is a re-render.
|
|
643
651
|
var _queue = workInProgressHook.queue;
|
|
644
652
|
var _dispatch = _queue.dispatch;
|
|
645
|
-
if (_this.
|
|
646
|
-
//
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
_this._renderPhaseUpdates.
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
return [newState, _dispatch];
|
|
653
|
+
if (_this._numberOfReRenders > 0) {
|
|
654
|
+
// Apply the new render phase updates to the previous current hook.
|
|
655
|
+
if (_this._renderPhaseUpdates !== null) {
|
|
656
|
+
// Render phase updates are stored in a map of queue -> linked list
|
|
657
|
+
var firstRenderPhaseUpdate = _this._renderPhaseUpdates.get(_queue);
|
|
658
|
+
if (firstRenderPhaseUpdate !== undefined) {
|
|
659
|
+
_this._renderPhaseUpdates.delete(_queue);
|
|
660
|
+
var _newState = workInProgressHook.memoizedState;
|
|
661
|
+
var _update = firstRenderPhaseUpdate;
|
|
662
|
+
do {
|
|
663
|
+
var _action = _update.action;
|
|
664
|
+
_newState = reducer(_newState, _action);
|
|
665
|
+
_update = _update.next;
|
|
666
|
+
} while (_update !== null);
|
|
667
|
+
workInProgressHook.memoizedState = _newState;
|
|
668
|
+
return [_newState, _dispatch];
|
|
669
|
+
}
|
|
664
670
|
}
|
|
671
|
+
return [workInProgressHook.memoizedState, _dispatch];
|
|
672
|
+
}
|
|
673
|
+
// Process updates outside of render
|
|
674
|
+
var newState = workInProgressHook.memoizedState;
|
|
675
|
+
var update = _queue.first;
|
|
676
|
+
if (update !== null) {
|
|
677
|
+
do {
|
|
678
|
+
var _action2 = update.action;
|
|
679
|
+
newState = reducer(newState, _action2);
|
|
680
|
+
update = update.next;
|
|
681
|
+
} while (update !== null);
|
|
682
|
+
_queue.first = null;
|
|
683
|
+
workInProgressHook.memoizedState = newState;
|
|
665
684
|
}
|
|
666
|
-
return [
|
|
685
|
+
return [newState, _dispatch];
|
|
667
686
|
} else {
|
|
668
687
|
var initialState = void 0;
|
|
669
688
|
if (reducer === basicStateReducer) {
|
|
@@ -674,10 +693,10 @@ var ReactShallowRenderer = function () {
|
|
|
674
693
|
}
|
|
675
694
|
workInProgressHook.memoizedState = initialState;
|
|
676
695
|
var _queue2 = workInProgressHook.queue = {
|
|
677
|
-
|
|
696
|
+
first: null,
|
|
678
697
|
dispatch: null
|
|
679
698
|
};
|
|
680
|
-
var _dispatch2 = _queue2.dispatch = _this._dispatchAction.bind(_this,
|
|
699
|
+
var _dispatch2 = _queue2.dispatch = _this._dispatchAction.bind(_this, _queue2);
|
|
681
700
|
return [workInProgressHook.memoizedState, _dispatch2];
|
|
682
701
|
}
|
|
683
702
|
};
|
|
@@ -755,10 +774,10 @@ var ReactShallowRenderer = function () {
|
|
|
755
774
|
};
|
|
756
775
|
};
|
|
757
776
|
|
|
758
|
-
ReactShallowRenderer.prototype._dispatchAction = function _dispatchAction(
|
|
777
|
+
ReactShallowRenderer.prototype._dispatchAction = function _dispatchAction(queue, action) {
|
|
759
778
|
!(this._numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;
|
|
760
779
|
|
|
761
|
-
if (
|
|
780
|
+
if (this._rendering) {
|
|
762
781
|
// This is a render phase update. Stash it in a lazily-created map of
|
|
763
782
|
// queue -> linked list of updates. After this render pass, we'll restart
|
|
764
783
|
// and apply the stashed updates on top of the work-in-progress hook.
|
|
@@ -783,9 +802,24 @@ var ReactShallowRenderer = function () {
|
|
|
783
802
|
lastRenderPhaseUpdate.next = update;
|
|
784
803
|
}
|
|
785
804
|
} else {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
805
|
+
var _update2 = {
|
|
806
|
+
action: action,
|
|
807
|
+
next: null
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// Append the update to the end of the list.
|
|
811
|
+
var last = queue.first;
|
|
812
|
+
if (last === null) {
|
|
813
|
+
queue.first = _update2;
|
|
814
|
+
} else {
|
|
815
|
+
while (last.next !== null) {
|
|
816
|
+
last = last.next;
|
|
817
|
+
}
|
|
818
|
+
last.next = _update2;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// Re-render now.
|
|
822
|
+
this.render(this._element, this._context);
|
|
789
823
|
}
|
|
790
824
|
};
|
|
791
825
|
|
|
@@ -814,14 +848,6 @@ var ReactShallowRenderer = function () {
|
|
|
814
848
|
return this._workInProgressHook;
|
|
815
849
|
};
|
|
816
850
|
|
|
817
|
-
ReactShallowRenderer.prototype._prepareToUseHooks = function _prepareToUseHooks(componentIdentity) {
|
|
818
|
-
if (this._previousComponentIdentity !== null && this._previousComponentIdentity !== componentIdentity) {
|
|
819
|
-
this._firstWorkInProgressHook = null;
|
|
820
|
-
}
|
|
821
|
-
this._currentlyRenderingComponent = componentIdentity;
|
|
822
|
-
this._previousComponentIdentity = componentIdentity;
|
|
823
|
-
};
|
|
824
|
-
|
|
825
851
|
ReactShallowRenderer.prototype._finishHooks = function _finishHooks(element, context) {
|
|
826
852
|
if (this._didScheduleRenderPhaseUpdate) {
|
|
827
853
|
// Updates were scheduled during the render phase. They are stored in
|
|
@@ -836,7 +862,6 @@ var ReactShallowRenderer = function () {
|
|
|
836
862
|
this._rendering = false;
|
|
837
863
|
this.render(element, context);
|
|
838
864
|
} else {
|
|
839
|
-
this._currentlyRenderingComponent = null;
|
|
840
865
|
this._workInProgressHook = null;
|
|
841
866
|
this._renderPhaseUpdates = null;
|
|
842
867
|
this._numberOfReRenders = 0;
|
|
@@ -858,50 +883,74 @@ var ReactShallowRenderer = function () {
|
|
|
858
883
|
element = element;
|
|
859
884
|
// Show a special message for host elements since it's a common case.
|
|
860
885
|
!(typeof element.type !== 'string') ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : void 0;
|
|
861
|
-
!(isForwardRef(element) || typeof element.type === 'function') ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `%s`.', Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) : void 0;
|
|
886
|
+
!(isForwardRef(element) || typeof element.type === 'function' || isMemo(element.type)) ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `%s`.', Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) : void 0;
|
|
862
887
|
|
|
863
888
|
if (this._rendering) {
|
|
864
889
|
return;
|
|
865
890
|
}
|
|
891
|
+
if (this._element != null && this._element.type !== element.type) {
|
|
892
|
+
this._reset();
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
var elementType = isMemo(element.type) ? element.type.type : element.type;
|
|
896
|
+
var previousElement = this._element;
|
|
866
897
|
|
|
867
898
|
this._rendering = true;
|
|
868
899
|
this._element = element;
|
|
869
|
-
this._context = getMaskedContext(
|
|
900
|
+
this._context = getMaskedContext(elementType.contextTypes, context);
|
|
901
|
+
|
|
902
|
+
// Inner memo component props aren't currently validated in createElement.
|
|
903
|
+
if (isMemo(element.type) && elementType.propTypes) {
|
|
904
|
+
currentlyValidatingElement = element;
|
|
905
|
+
checkPropTypes_1(elementType.propTypes, element.props, 'prop', getComponentName(elementType), getStackAddendum);
|
|
906
|
+
}
|
|
870
907
|
|
|
871
908
|
if (this._instance) {
|
|
872
|
-
this._updateClassComponent(element, this._context);
|
|
909
|
+
this._updateClassComponent(elementType, element, this._context);
|
|
873
910
|
} else {
|
|
874
|
-
if (
|
|
875
|
-
this.
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
if (typeof element.type.getDerivedStateFromProps === 'function') {
|
|
880
|
-
var partialState = element.type.getDerivedStateFromProps.call(null, element.props, this._instance.state);
|
|
911
|
+
if (shouldConstruct(elementType)) {
|
|
912
|
+
this._instance = new elementType(element.props, this._context, this._updater);
|
|
913
|
+
if (typeof elementType.getDerivedStateFromProps === 'function') {
|
|
914
|
+
var partialState = elementType.getDerivedStateFromProps.call(null, element.props, this._instance.state);
|
|
881
915
|
if (partialState != null) {
|
|
882
916
|
this._instance.state = _assign({}, this._instance.state, partialState);
|
|
883
917
|
}
|
|
884
918
|
}
|
|
885
919
|
|
|
886
|
-
if (
|
|
920
|
+
if (elementType.contextTypes) {
|
|
887
921
|
currentlyValidatingElement = element;
|
|
888
|
-
|
|
889
|
-
checkPropTypes_1(element.type.contextTypes, this._context, 'context', getName(element.type, this._instance), getStackAddendum);
|
|
922
|
+
checkPropTypes_1(elementType.contextTypes, this._context, 'context', getName(elementType, this._instance), getStackAddendum);
|
|
890
923
|
|
|
891
924
|
currentlyValidatingElement = null;
|
|
892
925
|
}
|
|
893
926
|
|
|
894
|
-
this._mountClassComponent(element, this._context);
|
|
927
|
+
this._mountClassComponent(elementType, element, this._context);
|
|
895
928
|
} else {
|
|
896
|
-
var
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
929
|
+
var shouldRender = true;
|
|
930
|
+
if (isMemo(element.type) && previousElement !== null) {
|
|
931
|
+
// This is a Memo component that is being re-rendered.
|
|
932
|
+
var compare = element.type.compare || shallowEqual;
|
|
933
|
+
if (compare(previousElement.props, element.props)) {
|
|
934
|
+
shouldRender = false;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
if (shouldRender) {
|
|
938
|
+
var prevDispatcher = ReactCurrentDispatcher.current;
|
|
939
|
+
ReactCurrentDispatcher.current = this._dispatcher;
|
|
940
|
+
try {
|
|
941
|
+
// elementType could still be a ForwardRef if it was
|
|
942
|
+
// nested inside Memo.
|
|
943
|
+
if (elementType.$$typeof === ForwardRef) {
|
|
944
|
+
!(typeof elementType.render === 'function') ? invariant(false, 'forwardRef requires a render function but was given %s.', typeof elementType.render) : void 0;
|
|
945
|
+
this._rendered = elementType.render.call(undefined, element.props, element.ref);
|
|
946
|
+
} else {
|
|
947
|
+
this._rendered = elementType(element.props, this._context);
|
|
948
|
+
}
|
|
949
|
+
} finally {
|
|
950
|
+
ReactCurrentDispatcher.current = prevDispatcher;
|
|
951
|
+
}
|
|
952
|
+
this._finishHooks(element, context);
|
|
903
953
|
}
|
|
904
|
-
this._finishHooks(element, context);
|
|
905
954
|
}
|
|
906
955
|
}
|
|
907
956
|
|
|
@@ -917,17 +966,10 @@ var ReactShallowRenderer = function () {
|
|
|
917
966
|
this._instance.componentWillUnmount();
|
|
918
967
|
}
|
|
919
968
|
}
|
|
920
|
-
|
|
921
|
-
this._firstWorkInProgressHook = null;
|
|
922
|
-
this._previousComponentIdentity = null;
|
|
923
|
-
this._context = null;
|
|
924
|
-
this._element = null;
|
|
925
|
-
this._newState = null;
|
|
926
|
-
this._rendered = null;
|
|
927
|
-
this._instance = null;
|
|
969
|
+
this._reset();
|
|
928
970
|
};
|
|
929
971
|
|
|
930
|
-
ReactShallowRenderer.prototype._mountClassComponent = function _mountClassComponent(element, context) {
|
|
972
|
+
ReactShallowRenderer.prototype._mountClassComponent = function _mountClassComponent(elementType, element, context) {
|
|
931
973
|
this._instance.context = context;
|
|
932
974
|
this._instance.props = element.props;
|
|
933
975
|
this._instance.state = this._instance.state || null;
|
|
@@ -938,7 +980,7 @@ var ReactShallowRenderer = function () {
|
|
|
938
980
|
|
|
939
981
|
// In order to support react-lifecycles-compat polyfilled components,
|
|
940
982
|
// Unsafe lifecycles should not be invoked for components using the new APIs.
|
|
941
|
-
if (typeof
|
|
983
|
+
if (typeof elementType.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
|
|
942
984
|
if (typeof this._instance.componentWillMount === 'function') {
|
|
943
985
|
this._instance.componentWillMount();
|
|
944
986
|
}
|
|
@@ -958,9 +1000,8 @@ var ReactShallowRenderer = function () {
|
|
|
958
1000
|
// because DOM refs are not available.
|
|
959
1001
|
};
|
|
960
1002
|
|
|
961
|
-
ReactShallowRenderer.prototype._updateClassComponent = function _updateClassComponent(element, context) {
|
|
962
|
-
var props = element.props
|
|
963
|
-
type = element.type;
|
|
1003
|
+
ReactShallowRenderer.prototype._updateClassComponent = function _updateClassComponent(elementType, element, context) {
|
|
1004
|
+
var props = element.props;
|
|
964
1005
|
|
|
965
1006
|
|
|
966
1007
|
var oldState = this._instance.state || emptyObject;
|
|
@@ -969,7 +1010,7 @@ var ReactShallowRenderer = function () {
|
|
|
969
1010
|
if (oldProps !== props) {
|
|
970
1011
|
// In order to support react-lifecycles-compat polyfilled components,
|
|
971
1012
|
// Unsafe lifecycles should not be invoked for components using the new APIs.
|
|
972
|
-
if (typeof
|
|
1013
|
+
if (typeof elementType.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
|
|
973
1014
|
if (typeof this._instance.componentWillReceiveProps === 'function') {
|
|
974
1015
|
this._instance.componentWillReceiveProps(props, context);
|
|
975
1016
|
}
|
|
@@ -981,8 +1022,8 @@ var ReactShallowRenderer = function () {
|
|
|
981
1022
|
|
|
982
1023
|
// Read state after cWRP in case it calls setState
|
|
983
1024
|
var state = this._newState || oldState;
|
|
984
|
-
if (typeof
|
|
985
|
-
var partialState =
|
|
1025
|
+
if (typeof elementType.getDerivedStateFromProps === 'function') {
|
|
1026
|
+
var partialState = elementType.getDerivedStateFromProps.call(null, props, state);
|
|
986
1027
|
if (partialState != null) {
|
|
987
1028
|
state = _assign({}, state, partialState);
|
|
988
1029
|
}
|
|
@@ -994,14 +1035,14 @@ var ReactShallowRenderer = function () {
|
|
|
994
1035
|
this._forcedUpdate = false;
|
|
995
1036
|
} else if (typeof this._instance.shouldComponentUpdate === 'function') {
|
|
996
1037
|
shouldUpdate = !!this._instance.shouldComponentUpdate(props, state, context);
|
|
997
|
-
} else if (
|
|
1038
|
+
} else if (elementType.prototype && elementType.prototype.isPureReactComponent) {
|
|
998
1039
|
shouldUpdate = !shallowEqual(oldProps, props) || !shallowEqual(oldState, state);
|
|
999
1040
|
}
|
|
1000
1041
|
|
|
1001
1042
|
if (shouldUpdate) {
|
|
1002
1043
|
// In order to support react-lifecycles-compat polyfilled components,
|
|
1003
1044
|
// Unsafe lifecycles should not be invoked for components using the new APIs.
|
|
1004
|
-
if (typeof
|
|
1045
|
+
if (typeof elementType.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
|
|
1005
1046
|
if (typeof this._instance.componentWillUpdate === 'function') {
|
|
1006
1047
|
this._instance.componentWillUpdate(props, state, context);
|
|
1007
1048
|
}
|
|
@@ -1040,7 +1081,8 @@ function getDisplayName(element) {
|
|
|
1040
1081
|
} else if (typeof element.type === 'string') {
|
|
1041
1082
|
return element.type;
|
|
1042
1083
|
} else {
|
|
1043
|
-
|
|
1084
|
+
var elementType = isMemo(element.type) ? element.type.type : element.type;
|
|
1085
|
+
return elementType.displayName || elementType.name || 'Unknown';
|
|
1044
1086
|
}
|
|
1045
1087
|
}
|
|
1046
1088
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.6
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,25 +6,26 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';(function(
|
|
10
|
-
a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function m(a){for(var b=arguments.length-1,
|
|
11
|
-
default:switch(a=a&&a.$$typeof,a){case
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function(b
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
function(){
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
'use strict';(function(l,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react")):"function"===typeof define&&define.amd?define(["react"],p):l.ReactShallowRenderer=p(l.React)})(this,function(l){function p(a,b,d,c,g,k,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var e=[d,c,g,k,h,f],M=0;a=Error(b.replace(/%s/g,function(){return e[M++]}));
|
|
10
|
+
a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function m(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);p(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}function q(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case N:switch(a=a.type,a){case O:case A:case B:case C:case D:case E:return a;
|
|
11
|
+
default:switch(a=a&&a.$$typeof,a){case F:case r:case G:return a;default:return b}}case H:case n:case I:return b}}}function v(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case A:return"ConcurrentMode";case B:return"Fragment";case I:return"Portal";case C:return"Profiler";case D:return"StrictMode";case E:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case F:return"Context.Consumer";case G:return"Context.Provider";
|
|
12
|
+
case r:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case n:return v(a.type);case H:if(a=1===a._status?a._result:null)return v(a)}return null}function w(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function x(a,b){if(w(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var d=Object.keys(a),c=Object.keys(b);if(d.length!==c.length)return!1;for(c=0;c<d.length;c++)if(!P.call(b,d[c])||!w(a[d[c]],b[d[c]]))return!1;
|
|
13
|
+
return!0}function J(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function K(){return{memoizedState:null,queue:null,next:null}}function L(a,b){return"function"===typeof b?b(a):b}var y=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,e="function"===typeof Symbol&&Symbol.for,N=e?Symbol.for("react.element"):60103,I=e?Symbol.for("react.portal"):60106,B=e?Symbol.for("react.fragment"):60107,D=e?Symbol.for("react.strict_mode"):60108,C=e?Symbol.for("react.profiler"):
|
|
14
|
+
60114,G=e?Symbol.for("react.provider"):60109,F=e?Symbol.for("react.context"):60110,O=e?Symbol.for("react.async_mode"):60111,A=e?Symbol.for("react.concurrent_mode"):60111,r=e?Symbol.for("react.forward_ref"):60112,E=e?Symbol.for("react.suspense"):60113,n=e?Symbol.for("react.memo"):60115,H=e?Symbol.for("react.lazy"):60116,Q=r,P=Object.prototype.hasOwnProperty;e=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e.hasOwnProperty("ReactCurrentDispatcher")||(e.ReactCurrentDispatcher={current:null});var z=
|
|
15
|
+
e.ReactCurrentDispatcher,t={},R=function(){function a(b){J(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(b){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a,c){this._enqueueCallback(a,
|
|
16
|
+
b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c,g){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c,g){this._enqueueCallback(c,b);c=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,c,b.props));null!==a&&void 0!==a&&(this._renderer._newState=y({},c,a),this._renderer.render(this._renderer._element,
|
|
17
|
+
this._renderer._context))};return a}(),u=function(){function a(){J(this,a);this._reset()}a.prototype._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new R(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};a.prototype._validateCurrentlyRenderingComponent=
|
|
18
|
+
function(){!this._rendering||this._instance?m("321"):void 0};a.prototype._createDispatcher=function(){var b=this,a=function(a,c,d){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();var f=b._workInProgressHook;if(b._isReRender){d=f.queue;c=d.dispatch;if(0<b._numberOfReRenders){if(null!==b._renderPhaseUpdates){var g=b._renderPhaseUpdates.get(d);if(void 0!==g){b._renderPhaseUpdates.delete(d);d=f.memoizedState;do d=a(d,g.action),g=g.next;while(null!==g);f.memoizedState=d;return[d,
|
|
19
|
+
c]}}return[f.memoizedState,c]}g=f.memoizedState;var k=d.first;if(null!==k){do g=a(g,k.action),k=k.next;while(null!==k);d.first=null;f.memoizedState=g}return[g,c]}a=a===L?"function"===typeof c?c():c:void 0!==d?d(c):c;f.memoizedState=a;a=f.queue={first:null,dispatch:null};a=a.dispatch=b._dispatchAction.bind(b,a);return[f.memoizedState,a]},c=function(){b._validateCurrentlyRenderingComponent()};return{readContext:function(b,a){return b._currentValue},useCallback:function(b){return b},useContext:function(a){b._validateCurrentlyRenderingComponent();
|
|
20
|
+
return a._currentValue},useDebugValue:c,useEffect:c,useImperativeHandle:c,useLayoutEffect:c,useMemo:function(a,c){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();c=void 0!==c?c:null;if(null!==b._workInProgressHook&&null!==b._workInProgressHook.memoizedState){var d=b._workInProgressHook.memoizedState,f=d[1];if(null!==c){a:if(null===f)f=!1;else{for(var g=0;g<f.length&&g<c.length;g++)if(!w(c[g],f[g])){f=!1;break a}f=!0}if(f)return d[0]}}a=a();b._workInProgressHook.memoizedState=
|
|
21
|
+
[a,c];return a},useReducer:a,useRef:function(a){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();var c=b._workInProgressHook.memoizedState;return null===c?(a={current:a},b._workInProgressHook.memoizedState=a):c},useState:function(b){return a(L,b)}}};a.prototype._dispatchAction=function(b,a){25>this._numberOfReRenders?void 0:m("301");if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};var c=this._renderPhaseUpdates;null===c&&(this._renderPhaseUpdates=
|
|
22
|
+
c=new Map);var d=c.get(b);if(void 0===d)c.set(b,a);else{for(b=d;null!==b.next;)b=b.next;b.next=a}}else{a={action:a,next:null};c=b.first;if(null===c)b.first=a;else{for(;null!==c.next;)c=c.next;c.next=a}this.render(this._element,this._context)}};a.prototype._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=K()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):
|
|
23
|
+
null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=K()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};a.prototype._finishHooks=function(b,a){this._didScheduleRenderPhaseUpdate?(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(b,a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=
|
|
24
|
+
0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t;l.isValidElement(a)?void 0:m("12","function"===typeof a?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");"string"===typeof a.type?m("13",a.type):void 0;q(a)!==r&&"function"!==typeof a.type&&q(a.type)!==n?m("249",Array.isArray(a.type)?
|
|
25
|
+
"array":null===a.type?"null":typeof a.type):void 0;if(!this._rendering){null!=this._element&&this._element.type!==a.type&&this._reset();var c=q(a.type)===n?a.type.type:a.type,g=this._element;this._rendering=!0;this._element=a;var e;if((e=c.contextTypes)&&b){var h={},f;for(f in e)h[f]=b[f];e=h}else e=t;this._context=e;q(a.type)===n&&c.propTypes&&v(c);if(this._instance)this._updateClassComponent(c,a,this._context);else if(c.prototype&&c.prototype.isReactComponent)this._instance=new c(a.props,this._context,
|
|
26
|
+
this._updater),"function"===typeof c.getDerivedStateFromProps&&(b=c.getDerivedStateFromProps.call(null,a.props,this._instance.state),null!=b&&(this._instance.state=y({},this._instance.state,b))),this._mountClassComponent(c,a,this._context);else if(e=!0,q(a.type)===n&&null!==g&&(a.type.compare||x)(g.props,a.props)&&(e=!1),e){g=z.current;z.current=this._dispatcher;try{c.$$typeof===Q?("function"!==typeof c.render?m("322",typeof c.render):void 0,this._rendered=c.render.call(void 0,a.props,a.ref)):this._rendered=
|
|
27
|
+
c(a.props,this._context)}finally{z.current=g}this._finishHooks(a,b)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};a.prototype._mountClassComponent=function(a,d,c){this._instance.context=c;this._instance.props=d.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===
|
|
28
|
+
typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)d=this._newState,"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),d!==this._newState&&(this._instance.state=this._newState||t);this._rendered=
|
|
29
|
+
this._instance.render()};a.prototype._updateClassComponent=function(a,d,c){d=d.props;var b=this._instance.state||t,e=this._instance.props;e!==d&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(d,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(d,c));var h=this._newState||
|
|
30
|
+
b;if("function"===typeof a.getDerivedStateFromProps){var f=a.getDerivedStateFromProps.call(null,d,h);null!=f&&(h=y({},h,f))}f=!0;this._forcedUpdate?(f=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?f=!!this._instance.shouldComponentUpdate(d,h,c):a.prototype&&a.prototype.isPureReactComponent&&(f=!x(e,d)||!x(b,h));f&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&
|
|
31
|
+
this._instance.componentWillUpdate(d,h,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(d,h,c));this._instance.context=c;this._instance.props=d;this._instance.state=h;this._newState=null;f&&(this._rendered=this._instance.render())};return a}();u.createRenderer=function(){return new u};e=(e={default:u},u)||e;return e.default||e});
|