react-test-renderer 16.10.0 → 16.12.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.
- package/build-info.json +4 -4
- package/cjs/react-test-renderer-shallow.development.js +73 -77
- package/cjs/react-test-renderer-shallow.production.min.js +25 -25
- package/cjs/react-test-renderer.development.js +739 -687
- package/cjs/react-test-renderer.production.min.js +148 -145
- package/package.json +2 -2
- package/umd/react-test-renderer-shallow.development.js +75 -79
- package/umd/react-test-renderer-shallow.production.min.js +24 -24
- package/umd/react-test-renderer.development.js +743 -691
- package/umd/react-test-renderer.production.min.js +145 -143
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "59518",
|
|
4
|
+
"checksum": "6f449c4",
|
|
5
|
+
"commit": "b53ea6ca0",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.11.0-b53ea6ca0"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -21,16 +21,8 @@ var reactIs = require('react-is');
|
|
|
21
21
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
22
22
|
|
|
23
23
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
24
|
-
// template literal strings. The messages will be
|
|
25
|
-
// build
|
|
26
|
-
|
|
27
|
-
// Do not require this module directly! Use normal `invariant` calls with
|
|
28
|
-
// template literal strings. The messages will be converted to ReactError during
|
|
29
|
-
// build, and in production they will be minified.
|
|
30
|
-
function ReactError(error) {
|
|
31
|
-
error.name = 'Invariant Violation';
|
|
32
|
-
return error;
|
|
33
|
-
}
|
|
24
|
+
// template literal strings. The messages will be replaced with error codes
|
|
25
|
+
// during build.
|
|
34
26
|
|
|
35
27
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
36
28
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
@@ -463,40 +455,36 @@ function () {
|
|
|
463
455
|
};
|
|
464
456
|
|
|
465
457
|
_proto2._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
if (!(_this._rendering && !_this._instance)) {
|
|
470
|
-
{
|
|
471
|
-
throw ReactError(Error("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."));
|
|
472
|
-
}
|
|
458
|
+
if (!(this._rendering && !this._instance)) {
|
|
459
|
+
{
|
|
460
|
+
throw Error("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.");
|
|
473
461
|
}
|
|
474
|
-
}
|
|
462
|
+
}
|
|
475
463
|
};
|
|
476
464
|
|
|
477
465
|
_proto2._createDispatcher = function _createDispatcher() {
|
|
478
|
-
var
|
|
466
|
+
var _this = this;
|
|
479
467
|
|
|
480
468
|
var useReducer = function (reducer, initialArg, init) {
|
|
481
|
-
|
|
469
|
+
_this._validateCurrentlyRenderingComponent();
|
|
482
470
|
|
|
483
|
-
|
|
471
|
+
_this._createWorkInProgressHook();
|
|
484
472
|
|
|
485
|
-
var workInProgressHook =
|
|
473
|
+
var workInProgressHook = _this._workInProgressHook;
|
|
486
474
|
|
|
487
|
-
if (
|
|
475
|
+
if (_this._isReRender) {
|
|
488
476
|
// This is a re-render.
|
|
489
477
|
var queue = workInProgressHook.queue;
|
|
490
478
|
var dispatch = queue.dispatch;
|
|
491
479
|
|
|
492
|
-
if (
|
|
480
|
+
if (_this._numberOfReRenders > 0) {
|
|
493
481
|
// Apply the new render phase updates to the previous current hook.
|
|
494
|
-
if (
|
|
482
|
+
if (_this._renderPhaseUpdates !== null) {
|
|
495
483
|
// Render phase updates are stored in a map of queue -> linked list
|
|
496
|
-
var firstRenderPhaseUpdate =
|
|
484
|
+
var firstRenderPhaseUpdate = _this._renderPhaseUpdates.get(queue);
|
|
497
485
|
|
|
498
486
|
if (firstRenderPhaseUpdate !== undefined) {
|
|
499
|
-
|
|
487
|
+
_this._renderPhaseUpdates.delete(queue);
|
|
500
488
|
|
|
501
489
|
var _newState = workInProgressHook.memoizedState;
|
|
502
490
|
var _update = firstRenderPhaseUpdate;
|
|
@@ -548,7 +536,7 @@ function () {
|
|
|
548
536
|
dispatch: null
|
|
549
537
|
};
|
|
550
538
|
|
|
551
|
-
var _dispatch = _queue.dispatch =
|
|
539
|
+
var _dispatch = _queue.dispatch = _this._dispatchAction.bind(_this, _queue);
|
|
552
540
|
|
|
553
541
|
return [workInProgressHook.memoizedState, _dispatch];
|
|
554
542
|
}
|
|
@@ -560,14 +548,14 @@ function () {
|
|
|
560
548
|
};
|
|
561
549
|
|
|
562
550
|
var useMemo = function (nextCreate, deps) {
|
|
563
|
-
|
|
551
|
+
_this._validateCurrentlyRenderingComponent();
|
|
564
552
|
|
|
565
|
-
|
|
553
|
+
_this._createWorkInProgressHook();
|
|
566
554
|
|
|
567
555
|
var nextDeps = deps !== undefined ? deps : null;
|
|
568
556
|
|
|
569
|
-
if (
|
|
570
|
-
var prevState =
|
|
557
|
+
if (_this._workInProgressHook !== null && _this._workInProgressHook.memoizedState !== null) {
|
|
558
|
+
var prevState = _this._workInProgressHook.memoizedState;
|
|
571
559
|
var prevDeps = prevState[1];
|
|
572
560
|
|
|
573
561
|
if (nextDeps !== null) {
|
|
@@ -578,16 +566,16 @@ function () {
|
|
|
578
566
|
}
|
|
579
567
|
|
|
580
568
|
var nextValue = nextCreate();
|
|
581
|
-
|
|
569
|
+
_this._workInProgressHook.memoizedState = [nextValue, nextDeps];
|
|
582
570
|
return nextValue;
|
|
583
571
|
};
|
|
584
572
|
|
|
585
573
|
var useRef = function (initialValue) {
|
|
586
|
-
|
|
574
|
+
_this._validateCurrentlyRenderingComponent();
|
|
587
575
|
|
|
588
|
-
|
|
576
|
+
_this._createWorkInProgressHook();
|
|
589
577
|
|
|
590
|
-
var previousRef =
|
|
578
|
+
var previousRef = _this._workInProgressHook.memoizedState;
|
|
591
579
|
|
|
592
580
|
if (previousRef === null) {
|
|
593
581
|
var ref = {
|
|
@@ -598,7 +586,7 @@ function () {
|
|
|
598
586
|
Object.seal(ref);
|
|
599
587
|
}
|
|
600
588
|
|
|
601
|
-
|
|
589
|
+
_this._workInProgressHook.memoizedState = ref;
|
|
602
590
|
return ref;
|
|
603
591
|
} else {
|
|
604
592
|
return previousRef;
|
|
@@ -610,7 +598,7 @@ function () {
|
|
|
610
598
|
};
|
|
611
599
|
|
|
612
600
|
var noOp = function () {
|
|
613
|
-
|
|
601
|
+
_this._validateCurrentlyRenderingComponent();
|
|
614
602
|
};
|
|
615
603
|
|
|
616
604
|
var identity = function (fn) {
|
|
@@ -622,13 +610,31 @@ function () {
|
|
|
622
610
|
props: props,
|
|
623
611
|
responder: responder
|
|
624
612
|
};
|
|
613
|
+
}; // TODO: implement if we decide to keep the shallow renderer
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
var useTransition = function (config) {
|
|
617
|
+
_this._validateCurrentlyRenderingComponent();
|
|
618
|
+
|
|
619
|
+
var startTransition = function (callback) {
|
|
620
|
+
callback();
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
return [startTransition, false];
|
|
624
|
+
}; // TODO: implement if we decide to keep the shallow renderer
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
var useDeferredValue = function (value, config) {
|
|
628
|
+
_this._validateCurrentlyRenderingComponent();
|
|
629
|
+
|
|
630
|
+
return value;
|
|
625
631
|
};
|
|
626
632
|
|
|
627
633
|
return {
|
|
628
634
|
readContext: readContext,
|
|
629
635
|
useCallback: identity,
|
|
630
636
|
useContext: function (context) {
|
|
631
|
-
|
|
637
|
+
_this._validateCurrentlyRenderingComponent();
|
|
632
638
|
|
|
633
639
|
return readContext(context);
|
|
634
640
|
},
|
|
@@ -640,20 +646,18 @@ function () {
|
|
|
640
646
|
useReducer: useReducer,
|
|
641
647
|
useRef: useRef,
|
|
642
648
|
useState: useState,
|
|
643
|
-
useResponder: useResponder
|
|
649
|
+
useResponder: useResponder,
|
|
650
|
+
useTransition: useTransition,
|
|
651
|
+
useDeferredValue: useDeferredValue
|
|
644
652
|
};
|
|
645
653
|
};
|
|
646
654
|
|
|
647
655
|
_proto2._dispatchAction = function _dispatchAction(queue, action) {
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
if (!(_this3._numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
652
|
-
{
|
|
653
|
-
throw ReactError(Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."));
|
|
654
|
-
}
|
|
656
|
+
if (!(this._numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
657
|
+
{
|
|
658
|
+
throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
|
|
655
659
|
}
|
|
656
|
-
}
|
|
660
|
+
}
|
|
657
661
|
|
|
658
662
|
if (this._rendering) {
|
|
659
663
|
// This is a render phase update. Stash it in a lazily-created map of
|
|
@@ -763,31 +767,25 @@ function () {
|
|
|
763
767
|
_proto2.render = function render(element) {
|
|
764
768
|
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyObject;
|
|
765
769
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
throw ReactError(Error("ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '')));
|
|
770
|
-
}
|
|
770
|
+
if (!React.isValidElement(element)) {
|
|
771
|
+
{
|
|
772
|
+
throw Error("ReactShallowRenderer render(): Invalid component element." + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : ''));
|
|
771
773
|
}
|
|
772
|
-
}
|
|
774
|
+
}
|
|
773
775
|
|
|
774
776
|
element = element; // Show a special message for host elements since it's a common case.
|
|
775
777
|
|
|
776
|
-
(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
throw ReactError(Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead."));
|
|
780
|
-
}
|
|
778
|
+
if (!(typeof element.type !== 'string')) {
|
|
779
|
+
{
|
|
780
|
+
throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (" + element.type + "). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.");
|
|
781
781
|
}
|
|
782
|
-
}
|
|
782
|
+
}
|
|
783
783
|
|
|
784
|
-
(function () {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
throw ReactError(Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`."));
|
|
788
|
-
}
|
|
784
|
+
if (!(reactIs.isForwardRef(element) || typeof element.type === 'function' || reactIs.isMemo(element))) {
|
|
785
|
+
{
|
|
786
|
+
throw Error("ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `" + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + "`.");
|
|
789
787
|
}
|
|
790
|
-
}
|
|
788
|
+
}
|
|
791
789
|
|
|
792
790
|
if (this._rendering) {
|
|
793
791
|
return;
|
|
@@ -797,13 +795,13 @@ function () {
|
|
|
797
795
|
this._reset();
|
|
798
796
|
}
|
|
799
797
|
|
|
800
|
-
var elementType = reactIs.isMemo(element
|
|
798
|
+
var elementType = reactIs.isMemo(element) ? element.type.type : element.type;
|
|
801
799
|
var previousElement = this._element;
|
|
802
800
|
this._rendering = true;
|
|
803
801
|
this._element = element;
|
|
804
802
|
this._context = getMaskedContext(elementType.contextTypes, context); // Inner memo component props aren't currently validated in createElement.
|
|
805
803
|
|
|
806
|
-
if (reactIs.isMemo(element
|
|
804
|
+
if (reactIs.isMemo(element) && elementType.propTypes) {
|
|
807
805
|
currentlyValidatingElement = element;
|
|
808
806
|
checkPropTypes(elementType.propTypes, element.props, 'prop', getComponentName(elementType), getStackAddendum);
|
|
809
807
|
}
|
|
@@ -832,7 +830,7 @@ function () {
|
|
|
832
830
|
} else {
|
|
833
831
|
var shouldRender = true;
|
|
834
832
|
|
|
835
|
-
if (reactIs.isMemo(element
|
|
833
|
+
if (reactIs.isMemo(element) && previousElement !== null) {
|
|
836
834
|
// This is a Memo component that is being re-rendered.
|
|
837
835
|
var compare = element.type.compare || shallowEqual;
|
|
838
836
|
|
|
@@ -849,13 +847,11 @@ function () {
|
|
|
849
847
|
// elementType could still be a ForwardRef if it was
|
|
850
848
|
// nested inside Memo.
|
|
851
849
|
if (elementType.$$typeof === reactIs.ForwardRef) {
|
|
852
|
-
(function
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
throw ReactError(Error("forwardRef requires a render function but was given " + typeof elementType.render + "."));
|
|
856
|
-
}
|
|
850
|
+
if (!(typeof elementType.render === 'function')) {
|
|
851
|
+
{
|
|
852
|
+
throw Error("forwardRef requires a render function but was given " + typeof elementType.render + ".");
|
|
857
853
|
}
|
|
858
|
-
}
|
|
854
|
+
}
|
|
859
855
|
|
|
860
856
|
this._rendered = elementType.render.call(undefined, element.props, element.ref);
|
|
861
857
|
} else {
|
|
@@ -1001,7 +997,7 @@ function getDisplayName(element) {
|
|
|
1001
997
|
} else if (typeof element.type === 'string') {
|
|
1002
998
|
return element.type;
|
|
1003
999
|
} else {
|
|
1004
|
-
var elementType = reactIs.isMemo(element
|
|
1000
|
+
var elementType = reactIs.isMemo(element) ? element.type.type : element.type;
|
|
1005
1001
|
return elementType.displayName || elementType.name || 'Unknown';
|
|
1006
1002
|
}
|
|
1007
1003
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,28 +7,28 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var
|
|
11
|
-
var r=/^(.*)[\\\/]/,t="function"===typeof Symbol&&Symbol.for,u=t?Symbol.for("react.portal"):60106,v=t?Symbol.for("react.fragment"):60107,w=t?Symbol.for("react.strict_mode"):60108,x=t?Symbol.for("react.profiler"):60114,y=t?Symbol.for("react.provider"):60109,z=t?Symbol.for("react.context"):60110,A=t?Symbol.for("react.forward_ref"):60112,B=t?Symbol.for("react.suspense"):60113,C=t?Symbol.for("react.suspense_list"):60120,D=t?Symbol.for("react.memo"):60115,E=t?Symbol.for("react.lazy"):60116,F=
|
|
10
|
+
'use strict';var h=require("object-assign"),l=require("react"),m=require("react-is"),n=require("prop-types/checkPropTypes");function p(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,a=1;a<arguments.length;a++)d+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
11
|
+
var r=/^(.*)[\\\/]/,t="function"===typeof Symbol&&Symbol.for,u=t?Symbol.for("react.portal"):60106,v=t?Symbol.for("react.fragment"):60107,w=t?Symbol.for("react.strict_mode"):60108,x=t?Symbol.for("react.profiler"):60114,y=t?Symbol.for("react.provider"):60109,z=t?Symbol.for("react.context"):60110,A=t?Symbol.for("react.forward_ref"):60112,B=t?Symbol.for("react.suspense"):60113,C=t?Symbol.for("react.suspense_list"):60120,D=t?Symbol.for("react.memo"):60115,E=t?Symbol.for("react.lazy"):60116,F=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
12
12
|
F.hasOwnProperty("ReactCurrentDispatcher")||(F.ReactCurrentDispatcher={current:null});F.hasOwnProperty("ReactCurrentBatchConfig")||(F.ReactCurrentBatchConfig={suspense:null});
|
|
13
|
-
function G(
|
|
14
|
-
case D:return G(
|
|
15
|
-
var L=F.ReactCurrentDispatcher,M={},N=function(){function
|
|
16
|
-
!0;this._renderer.render(this._renderer._element,this._renderer._context)};d.enqueueReplaceState=function(a,
|
|
17
|
-
return
|
|
18
|
-
var S=function(){function
|
|
19
|
-
this._instance)throw
|
|
20
|
-
return[b
|
|
21
|
-
return a._currentValue},useDebugValue:a,useEffect:a,useImperativeHandle:a,useLayoutEffect:a,useMemo:function(a,
|
|
22
|
-
[a,
|
|
23
|
-
null===e&&(this._renderPhaseUpdates=e=new Map);var
|
|
24
|
-
this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=O()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};d._finishHooks=function(a,
|
|
25
|
-
null,this._numberOfReRenders=0)};d.getMountedInstance=function(){return this._instance};d.getRenderOutput=function(){return this._rendered};d.render=function(a){var
|
|
26
|
-
!
|
|
27
|
-
else if(
|
|
28
|
-
|
|
29
|
-
this._instance.componentWillUnmount();this._reset()};d._mountClassComponent=function(a,b,
|
|
30
|
-
this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),b!==this._newState&&(this._instance.state=this._newState||M);this._rendered=this._instance.render()};d._updateClassComponent=function(a,b,
|
|
31
|
-
this._instance.componentWillReceiveProps(b,
|
|
32
|
-
(
|
|
33
|
-
S.createRenderer=function(){return new S};var Q=null;function T(
|
|
34
|
-
var U={default:S},V=U&&S||U;module.exports=V.default||V;
|
|
13
|
+
function G(c){if(null==c)return null;if("function"===typeof c)return c.displayName||c.name||null;if("string"===typeof c)return c;switch(c){case v:return"Fragment";case u:return"Portal";case x:return"Profiler";case w:return"StrictMode";case B:return"Suspense";case C:return"SuspenseList"}if("object"===typeof c)switch(c.$$typeof){case z:return"Context.Consumer";case y:return"Context.Provider";case A:var d=c.render;d=d.displayName||d.name||"";return c.displayName||(""!==d?"ForwardRef("+d+")":"ForwardRef");
|
|
14
|
+
case D:return G(c.type);case E:if(c=1===c._status?c._result:null)return G(c)}return null}function H(c,d){return c===d&&(0!==c||1/c===1/d)||c!==c&&d!==d}var I="function"===typeof Object.is?Object.is:H,J=Object.prototype.hasOwnProperty;function K(c,d){if(I(c,d))return!0;if("object"!==typeof c||null===c||"object"!==typeof d||null===d)return!1;var a=Object.keys(c),b=Object.keys(d);if(a.length!==b.length)return!1;for(b=0;b<a.length;b++)if(!J.call(d,a[b])||!I(c[a[b]],d[a[b]]))return!1;return!0}
|
|
15
|
+
var L=F.ReactCurrentDispatcher,M={},N=function(){function c(a){this._renderer=a;this._callbacks=[]}var d=c.prototype;d._enqueueCallback=function(a,b){"function"===typeof a&&b&&this._callbacks.push({callback:a,publicInstance:b})};d._invokeCallbacks=function(){var a=this._callbacks;this._callbacks=[];a.forEach(function(a){a.callback.call(a.publicInstance)})};d.isMounted=function(){return!!this._renderer._element};d.enqueueForceUpdate=function(a,b){this._enqueueCallback(b,a);this._renderer._forcedUpdate=
|
|
16
|
+
!0;this._renderer.render(this._renderer._element,this._renderer._context)};d.enqueueReplaceState=function(a,b,e){this._enqueueCallback(e,a);this._renderer._newState=b;this._renderer.render(this._renderer._element,this._renderer._context)};d.enqueueSetState=function(a,b,e){this._enqueueCallback(e,a);e=this._renderer._newState||a.state;"function"===typeof b&&(b=b.call(a,e,a.props));null!==b&&void 0!==b&&(this._renderer._newState=h({},e,{},b),this._renderer.render(this._renderer._element,this._renderer._context))};
|
|
17
|
+
return c}();function O(){return{memoizedState:null,queue:null,next:null}}function P(c,d){return"function"===typeof d?d(c):d}
|
|
18
|
+
var S=function(){function c(){this._reset()}var d=c.prototype;d._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new N(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};d._validateCurrentlyRenderingComponent=function(){if(!this._rendering||
|
|
19
|
+
this._instance)throw Error(p(321));};d._createDispatcher=function(){function a(){e._validateCurrentlyRenderingComponent()}function b(a,b,c){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();var d=e._workInProgressHook;if(e._isReRender){c=d.queue;b=c.dispatch;if(0<e._numberOfReRenders){if(null!==e._renderPhaseUpdates){var f=e._renderPhaseUpdates.get(c);if(void 0!==f){e._renderPhaseUpdates.delete(c);c=d.memoizedState;do c=a(c,f.action),f=f.next;while(null!==f);d.memoizedState=c;
|
|
20
|
+
return[c,b]}}return[d.memoizedState,b]}f=d.memoizedState;var q=c.first;if(null!==q){do f=a(f,q.action),q=q.next;while(null!==q);c.first=null;d.memoizedState=f}return[f,b]}a=a===P?"function"===typeof b?b():b:void 0!==c?c(b):b;d.memoizedState=a;a=d.queue={first:null,dispatch:null};a=a.dispatch=e._dispatchAction.bind(e,a);return[d.memoizedState,a]}var e=this;return{readContext:function(a){return a._currentValue},useCallback:function(a){return a},useContext:function(a){e._validateCurrentlyRenderingComponent();
|
|
21
|
+
return a._currentValue},useDebugValue:a,useEffect:a,useImperativeHandle:a,useLayoutEffect:a,useMemo:function(a,b){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();b=void 0!==b?b:null;if(null!==e._workInProgressHook&&null!==e._workInProgressHook.memoizedState){var c=e._workInProgressHook.memoizedState,d=c[1];if(null!==b){a:if(null===d)d=!1;else{for(var f=0;f<d.length&&f<b.length;f++)if(!I(b[f],d[f])){d=!1;break a}d=!0}if(d)return c[0]}}a=a();e._workInProgressHook.memoizedState=
|
|
22
|
+
[a,b];return a},useReducer:b,useRef:function(a){e._validateCurrentlyRenderingComponent();e._createWorkInProgressHook();var b=e._workInProgressHook.memoizedState;return null===b?(a={current:a},e._workInProgressHook.memoizedState=a):b},useState:function(a){return b(P,a)},useResponder:function(a,b){return{props:b,responder:a}},useTransition:function(){e._validateCurrentlyRenderingComponent();return[function(a){a()},!1]},useDeferredValue:function(a){e._validateCurrentlyRenderingComponent();return a}}};
|
|
23
|
+
d._dispatchAction=function(a,b){if(!(25>this._numberOfReRenders))throw Error(p(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;b={action:b,next:null};var e=this._renderPhaseUpdates;null===e&&(this._renderPhaseUpdates=e=new Map);var c=e.get(a);if(void 0===c)e.set(a,b);else{for(a=c;null!==a.next;)a=a.next;a.next=b}}else{b={action:b,next:null};e=a.first;if(null===e)a.first=b;else{for(;null!==e.next;)e=e.next;e.next=b}this.render(this._element,this._context)}};d._createWorkInProgressHook=
|
|
24
|
+
function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=O()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=O()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};d._finishHooks=function(a,b){this._didScheduleRenderPhaseUpdate?
|
|
25
|
+
(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(a,b)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};d.getMountedInstance=function(){return this._instance};d.getRenderOutput=function(){return this._rendered};d.render=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:M;if(!l.isValidElement(a))throw Error(p(12,"function"===typeof a?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
|
|
26
|
+
""));if("string"===typeof a.type)throw Error(p(13,a.type));if(!m.isForwardRef(a)&&"function"!==typeof a.type&&!m.isMemo(a))throw Error(p(249,Array.isArray(a.type)?"array":null===a.type?"null":typeof a.type));if(!this._rendering){null!=this._element&&this._element.type!==a.type&&this._reset();var e=m.isMemo(a)?a.type.type:a.type,c=this._element;this._rendering=!0;this._element=a;var d;if((d=e.contextTypes)&&b){var k={},g;for(g in d)k[g]=b[g];d=k}else d=M;this._context=d;m.isMemo(a)&&e.propTypes&&(Q=
|
|
27
|
+
a,n(e.propTypes,a.props,"prop",G(e),R));if(this._instance)this._updateClassComponent(e,a,this._context);else if(e.prototype&&e.prototype.isReactComponent)this._instance=new e(a.props,this._context,this._updater),"function"===typeof e.getDerivedStateFromProps&&(b=e.getDerivedStateFromProps.call(null,a.props,this._instance.state),null!=b&&(this._instance.state=h({},this._instance.state,b))),e.contextTypes&&(Q=a,b=(b=this._instance)&&b.constructor,n(e.contextTypes,this._context,"context",e.displayName||
|
|
28
|
+
b&&b.displayName||e.name||b&&b.name||null,R),Q=null),this._mountClassComponent(e,a,this._context);else if(d=!0,m.isMemo(a)&&null!==c&&(a.type.compare||K)(c.props,a.props)&&(d=!1),d){c=L.current;L.current=this._dispatcher;try{if(e.$$typeof===m.ForwardRef){if("function"!==typeof e.render)throw Error(p(322,typeof e.render));this._rendered=e.render.call(void 0,a.props,a.ref)}else this._rendered=e(a.props,this._context)}finally{L.current=c}this._finishHooks(a,b)}this._rendering=!1;this._updater._invokeCallbacks();
|
|
29
|
+
return this.getRenderOutput()}};d.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};d._mountClassComponent=function(a,b,c){this._instance.context=c;this._instance.props=b.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)b=this._newState,"function"!==
|
|
30
|
+
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()),b!==this._newState&&(this._instance.state=this._newState||M);this._rendered=this._instance.render()};d._updateClassComponent=function(a,b,c){b=b.props;var d=this._instance.state||M,e=this._instance.props;e!==
|
|
31
|
+
b&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,c));var k=this._newState||d;if("function"===typeof a.getDerivedStateFromProps){var g=a.getDerivedStateFromProps.call(null,b,k);null!=g&&(k=h({},k,g))}g=!0;this._forcedUpdate?
|
|
32
|
+
(g=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?g=!!this._instance.shouldComponentUpdate(b,k,c):a.prototype&&a.prototype.isPureReactComponent&&(g=!K(e,b)||!K(d,k));g&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,
|
|
33
|
+
k,c));this._instance.context=c;this._instance.props=b;this._instance.state=k;this._newState=null;g&&(this._rendered=this._instance.render())};return c}();S.createRenderer=function(){return new S};var Q=null;function T(c){if(null==c)return"#empty";if("string"===typeof c||"number"===typeof c)return"#text";if("string"===typeof c.type)return c.type;c=m.isMemo(c)?c.type.type:c.type;return c.displayName||c.name||"Unknown"}
|
|
34
|
+
function R(){var c="";if(Q){var d=T(Q),a=Q._owner,b=Q._source;a=a&&G(a.type);var e="";b?e=" (at "+b.fileName.replace(r,"")+":"+b.lineNumber+")":a&&(e=" (created by "+a+")");c+="\n in "+(d||"Unknown")+e}return c}var U={default:S},V=U&&S||U;module.exports=V.default||V;
|