react-test-renderer 16.8.5 → 16.9.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 +5 -5
- package/cjs/react-test-renderer-shallow.development.js +109 -73
- package/cjs/react-test-renderer-shallow.production.min.js +25 -26
- package/cjs/react-test-renderer.development.js +10787 -8048
- package/cjs/react-test-renderer.production.min.js +164 -154
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +108 -72
- package/umd/react-test-renderer-shallow.production.min.js +24 -24
- package/umd/react-test-renderer.development.js +8631 -5912
- package/umd/react-test-renderer.production.min.js +140 -129
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "master",
|
|
3
|
+
"buildNumber": "33869",
|
|
4
|
+
"checksum": "2fe1c5c",
|
|
5
|
+
"commit": "a1dbb852c",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.8.
|
|
7
|
+
"reactVersion": "16.8.6-canary-a1dbb852c"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.9.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -20,51 +20,19 @@ var React = require('react');
|
|
|
20
20
|
var reactIs = require('react-is');
|
|
21
21
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
27
|
-
* to provide information about what broke and what you were
|
|
28
|
-
* expecting.
|
|
29
|
-
*
|
|
30
|
-
* The invariant message will be stripped in production, but the invariant
|
|
31
|
-
* will remain to ensure logic does not differ in production.
|
|
32
|
-
*/
|
|
23
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
24
|
+
// template literal strings. The messages will be converted to ReactError during
|
|
25
|
+
// build, and in production they will be minified.
|
|
33
26
|
|
|
34
|
-
|
|
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.
|
|
35
30
|
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
throw new Error('invariant requires an error message argument');
|
|
40
|
-
}
|
|
41
|
-
};
|
|
31
|
+
function ReactError(error) {
|
|
32
|
+
error.name = 'Invariant Violation';
|
|
33
|
+
return error;
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
|
45
|
-
validateFormat(format);
|
|
46
|
-
|
|
47
|
-
if (!condition) {
|
|
48
|
-
var error = void 0;
|
|
49
|
-
if (format === undefined) {
|
|
50
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
51
|
-
} else {
|
|
52
|
-
var args = [a, b, c, d, e, f];
|
|
53
|
-
var argIndex = 0;
|
|
54
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
55
|
-
return args[argIndex++];
|
|
56
|
-
}));
|
|
57
|
-
error.name = 'Invariant Violation';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Relying on the `invariant()` implementation lets us
|
|
66
|
-
// preserve the format and params in the www builds.
|
|
67
|
-
|
|
68
36
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
69
37
|
|
|
70
38
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
@@ -154,10 +122,13 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
154
122
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
155
123
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
156
124
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
125
|
+
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
126
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
127
|
+
|
|
157
128
|
|
|
158
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
159
129
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
160
130
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
131
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
161
132
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
162
133
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
163
134
|
|
|
@@ -190,8 +161,6 @@ function getComponentName(type) {
|
|
|
190
161
|
return type;
|
|
191
162
|
}
|
|
192
163
|
switch (type) {
|
|
193
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
194
|
-
return 'ConcurrentMode';
|
|
195
164
|
case REACT_FRAGMENT_TYPE:
|
|
196
165
|
return 'Fragment';
|
|
197
166
|
case REACT_PORTAL_TYPE:
|
|
@@ -202,6 +171,8 @@ function getComponentName(type) {
|
|
|
202
171
|
return 'StrictMode';
|
|
203
172
|
case REACT_SUSPENSE_TYPE:
|
|
204
173
|
return 'Suspense';
|
|
174
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
175
|
+
return 'SuspenseList';
|
|
205
176
|
}
|
|
206
177
|
if (typeof type === 'object') {
|
|
207
178
|
switch (type.$$typeof) {
|
|
@@ -220,6 +191,7 @@ function getComponentName(type) {
|
|
|
220
191
|
if (resolvedThenable) {
|
|
221
192
|
return getComponentName(resolvedThenable);
|
|
222
193
|
}
|
|
194
|
+
break;
|
|
223
195
|
}
|
|
224
196
|
}
|
|
225
197
|
}
|
|
@@ -268,6 +240,17 @@ function shallowEqual(objA, objB) {
|
|
|
268
240
|
return true;
|
|
269
241
|
}
|
|
270
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
245
|
+
*
|
|
246
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
247
|
+
* to provide information about what broke and what you were
|
|
248
|
+
* expecting.
|
|
249
|
+
*
|
|
250
|
+
* The invariant message will be stripped in production, but the invariant
|
|
251
|
+
* will remain to ensure logic does not differ in production.
|
|
252
|
+
*/
|
|
253
|
+
|
|
271
254
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
272
255
|
|
|
273
256
|
// Prevent newer renderers from RTE when used with older react package versions.
|
|
@@ -278,6 +261,11 @@ if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
|
278
261
|
current: null
|
|
279
262
|
};
|
|
280
263
|
}
|
|
264
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
265
|
+
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
266
|
+
suspense: null
|
|
267
|
+
};
|
|
268
|
+
}
|
|
281
269
|
|
|
282
270
|
/**
|
|
283
271
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
@@ -446,28 +434,36 @@ var ReactShallowRenderer = function () {
|
|
|
446
434
|
};
|
|
447
435
|
|
|
448
436
|
ReactShallowRenderer.prototype._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
|
|
449
|
-
|
|
437
|
+
var _this = this;
|
|
438
|
+
|
|
439
|
+
(function () {
|
|
440
|
+
if (!(_this._rendering && !_this._instance)) {
|
|
441
|
+
{
|
|
442
|
+
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.'));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
})();
|
|
450
446
|
};
|
|
451
447
|
|
|
452
448
|
ReactShallowRenderer.prototype._createDispatcher = function _createDispatcher() {
|
|
453
|
-
var
|
|
449
|
+
var _this2 = this;
|
|
454
450
|
|
|
455
451
|
var useReducer = function (reducer, initialArg, init) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
var workInProgressHook =
|
|
452
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
453
|
+
_this2._createWorkInProgressHook();
|
|
454
|
+
var workInProgressHook = _this2._workInProgressHook;
|
|
459
455
|
|
|
460
|
-
if (
|
|
456
|
+
if (_this2._isReRender) {
|
|
461
457
|
// This is a re-render.
|
|
462
458
|
var _queue = workInProgressHook.queue;
|
|
463
459
|
var _dispatch = _queue.dispatch;
|
|
464
|
-
if (
|
|
460
|
+
if (_this2._numberOfReRenders > 0) {
|
|
465
461
|
// Apply the new render phase updates to the previous current hook.
|
|
466
|
-
if (
|
|
462
|
+
if (_this2._renderPhaseUpdates !== null) {
|
|
467
463
|
// Render phase updates are stored in a map of queue -> linked list
|
|
468
|
-
var firstRenderPhaseUpdate =
|
|
464
|
+
var firstRenderPhaseUpdate = _this2._renderPhaseUpdates.get(_queue);
|
|
469
465
|
if (firstRenderPhaseUpdate !== undefined) {
|
|
470
|
-
|
|
466
|
+
_this2._renderPhaseUpdates.delete(_queue);
|
|
471
467
|
var _newState = workInProgressHook.memoizedState;
|
|
472
468
|
var _update = firstRenderPhaseUpdate;
|
|
473
469
|
do {
|
|
@@ -507,7 +503,7 @@ var ReactShallowRenderer = function () {
|
|
|
507
503
|
first: null,
|
|
508
504
|
dispatch: null
|
|
509
505
|
};
|
|
510
|
-
var _dispatch2 = _queue2.dispatch =
|
|
506
|
+
var _dispatch2 = _queue2.dispatch = _this2._dispatchAction.bind(_this2, _queue2);
|
|
511
507
|
return [workInProgressHook.memoizedState, _dispatch2];
|
|
512
508
|
}
|
|
513
509
|
};
|
|
@@ -519,13 +515,13 @@ var ReactShallowRenderer = function () {
|
|
|
519
515
|
};
|
|
520
516
|
|
|
521
517
|
var useMemo = function (nextCreate, deps) {
|
|
522
|
-
|
|
523
|
-
|
|
518
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
519
|
+
_this2._createWorkInProgressHook();
|
|
524
520
|
|
|
525
521
|
var nextDeps = deps !== undefined ? deps : null;
|
|
526
522
|
|
|
527
|
-
if (
|
|
528
|
-
var prevState =
|
|
523
|
+
if (_this2._workInProgressHook !== null && _this2._workInProgressHook.memoizedState !== null) {
|
|
524
|
+
var prevState = _this2._workInProgressHook.memoizedState;
|
|
529
525
|
var prevDeps = prevState[1];
|
|
530
526
|
if (nextDeps !== null) {
|
|
531
527
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
@@ -535,20 +531,20 @@ var ReactShallowRenderer = function () {
|
|
|
535
531
|
}
|
|
536
532
|
|
|
537
533
|
var nextValue = nextCreate();
|
|
538
|
-
|
|
534
|
+
_this2._workInProgressHook.memoizedState = [nextValue, nextDeps];
|
|
539
535
|
return nextValue;
|
|
540
536
|
};
|
|
541
537
|
|
|
542
538
|
var useRef = function (initialValue) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
var previousRef =
|
|
539
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
540
|
+
_this2._createWorkInProgressHook();
|
|
541
|
+
var previousRef = _this2._workInProgressHook.memoizedState;
|
|
546
542
|
if (previousRef === null) {
|
|
547
543
|
var ref = { current: initialValue };
|
|
548
544
|
{
|
|
549
545
|
Object.seal(ref);
|
|
550
546
|
}
|
|
551
|
-
|
|
547
|
+
_this2._workInProgressHook.memoizedState = ref;
|
|
552
548
|
return ref;
|
|
553
549
|
} else {
|
|
554
550
|
return previousRef;
|
|
@@ -560,18 +556,25 @@ var ReactShallowRenderer = function () {
|
|
|
560
556
|
};
|
|
561
557
|
|
|
562
558
|
var noOp = function () {
|
|
563
|
-
|
|
559
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
564
560
|
};
|
|
565
561
|
|
|
566
562
|
var identity = function (fn) {
|
|
567
563
|
return fn;
|
|
568
564
|
};
|
|
569
565
|
|
|
566
|
+
var useResponder = function (responder, props) {
|
|
567
|
+
return {
|
|
568
|
+
props: props,
|
|
569
|
+
responder: responder
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
|
|
570
573
|
return {
|
|
571
574
|
readContext: readContext,
|
|
572
575
|
useCallback: identity,
|
|
573
576
|
useContext: function (context) {
|
|
574
|
-
|
|
577
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
575
578
|
return readContext(context);
|
|
576
579
|
},
|
|
577
580
|
useDebugValue: noOp,
|
|
@@ -581,12 +584,21 @@ var ReactShallowRenderer = function () {
|
|
|
581
584
|
useMemo: useMemo,
|
|
582
585
|
useReducer: useReducer,
|
|
583
586
|
useRef: useRef,
|
|
584
|
-
useState: useState
|
|
587
|
+
useState: useState,
|
|
588
|
+
useResponder: useResponder
|
|
585
589
|
};
|
|
586
590
|
};
|
|
587
591
|
|
|
588
592
|
ReactShallowRenderer.prototype._dispatchAction = function _dispatchAction(queue, action) {
|
|
589
|
-
|
|
593
|
+
var _this3 = this;
|
|
594
|
+
|
|
595
|
+
(function () {
|
|
596
|
+
if (!(_this3._numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
597
|
+
{
|
|
598
|
+
throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.'));
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
})();
|
|
590
602
|
|
|
591
603
|
if (this._rendering) {
|
|
592
604
|
// This is a render phase update. Stash it in a lazily-created map of
|
|
@@ -690,11 +702,29 @@ var ReactShallowRenderer = function () {
|
|
|
690
702
|
ReactShallowRenderer.prototype.render = function render(element) {
|
|
691
703
|
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyObject;
|
|
692
704
|
|
|
693
|
-
|
|
705
|
+
(function () {
|
|
706
|
+
if (!React.isValidElement(element)) {
|
|
707
|
+
{
|
|
708
|
+
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.' : '')));
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
})();
|
|
694
712
|
element = element;
|
|
695
713
|
// Show a special message for host elements since it's a common case.
|
|
696
|
-
|
|
697
|
-
|
|
714
|
+
(function () {
|
|
715
|
+
if (!(typeof element.type !== 'string')) {
|
|
716
|
+
{
|
|
717
|
+
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.'));
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
})();
|
|
721
|
+
(function () {
|
|
722
|
+
if (!(reactIs.isForwardRef(element) || typeof element.type === 'function' || reactIs.isMemo(element.type))) {
|
|
723
|
+
{
|
|
724
|
+
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) + '`.'));
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
})();
|
|
698
728
|
|
|
699
729
|
if (this._rendering) {
|
|
700
730
|
return;
|
|
@@ -752,7 +782,13 @@ var ReactShallowRenderer = function () {
|
|
|
752
782
|
// elementType could still be a ForwardRef if it was
|
|
753
783
|
// nested inside Memo.
|
|
754
784
|
if (elementType.$$typeof === reactIs.ForwardRef) {
|
|
755
|
-
|
|
785
|
+
(function () {
|
|
786
|
+
if (!(typeof elementType.render === 'function')) {
|
|
787
|
+
{
|
|
788
|
+
throw ReactError(Error('forwardRef requires a render function but was given ' + typeof elementType.render + '.'));
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
})();
|
|
756
792
|
this._rendered = elementType.render.call(undefined, element.props, element.ref);
|
|
757
793
|
} else {
|
|
758
794
|
this._rendered = elementType(element.props, this._context);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.9.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,29 +7,28 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var k=require("object-assign"),l=require("react"),m=require("react-is"),n=require("prop-types/checkPropTypes");function p(a
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var N=L.ReactCurrentDispatcher,O={},P=function(){function a(b){M(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(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,
|
|
10
|
+
'use strict';var k=require("object-assign"),l=require("react"),m=require("react-is"),n=require("prop-types/checkPropTypes");function p(a){for(var b=a.message,d="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)d+="&args[]="+encodeURIComponent(arguments[c]);a.message="Minified React error #"+b+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ";return a}
|
|
11
|
+
var q=/^(.*)[\\\/]/,r="function"===typeof Symbol&&Symbol.for,t=r?Symbol.for("react.portal"):60106,u=r?Symbol.for("react.fragment"):60107,v=r?Symbol.for("react.strict_mode"):60108,w=r?Symbol.for("react.profiler"):60114,x=r?Symbol.for("react.provider"):60109,y=r?Symbol.for("react.context"):60110,z=r?Symbol.for("react.forward_ref"):60112,A=r?Symbol.for("react.suspense"):60113,B=r?Symbol.for("react.suspense_list"):60120,C=r?Symbol.for("react.memo"):60115,D=r?Symbol.for("react.lazy"):60116;
|
|
12
|
+
function E(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 u:return"Fragment";case t:return"Portal";case w:return"Profiler";case v:return"StrictMode";case A:return"Suspense";case B:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case y:return"Context.Consumer";case x:return"Context.Provider";case z:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");
|
|
13
|
+
case C:return E(a.type);case D:if(a=1===a._status?a._result:null)return E(a)}return null}function F(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var G=Object.prototype.hasOwnProperty;function H(a,b){if(F(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(!G.call(b,d[c])||!F(a[d[c]],b[d[c]]))return!1;return!0}var I=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
14
|
+
I.hasOwnProperty("ReactCurrentDispatcher")||(I.ReactCurrentDispatcher={current:null});I.hasOwnProperty("ReactCurrentBatchConfig")||(I.ReactCurrentBatchConfig={suspense:null});function J(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
|
|
15
|
+
var K=I.ReactCurrentDispatcher,L={},M=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(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,
|
|
17
16
|
b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c){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=k({},c,a),this._renderer.render(this._renderer._element,
|
|
18
|
-
this._renderer._context))};return a}();function
|
|
19
|
-
var
|
|
20
|
-
this._instance
|
|
21
|
-
d;return[d,a]}}return[f.memoizedState,a]}e=f.memoizedState;var g=d.first;if(null!==g){do e=b(e,g.action),g=g.next;while(null!==g);d.first=null;f.memoizedState=e}return[e,a]}b=b===
|
|
22
|
-
return b._currentValue},useDebugValue:b,useEffect:b,useImperativeHandle:b,useLayoutEffect:b,useMemo:function(b,a){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();a=void 0!==a?a:null;if(null!==c._workInProgressHook&&null!==c._workInProgressHook.memoizedState){var d=c._workInProgressHook.memoizedState,f=d[1];if(null!==a){a:if(null===f)f=!1;else{for(var e=0;e<f.length&&e<a.length;e++)if(!
|
|
23
|
-
[b,a];return b},useReducer:a,useRef:function(b){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var a=c._workInProgressHook.memoizedState;return null===a?(b={current:b},c._workInProgressHook.memoizedState=b):a},useState:function(b){return a(
|
|
24
|
-
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=
|
|
25
|
-
null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=
|
|
26
|
-
0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
|
27
|
-
|
|
28
|
-
c.prototype.isReactComponent)this._instance=new c(b.props,this._context,this._updater),"function"===typeof c.getDerivedStateFromProps&&(a=c.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=k({},this._instance.state,a))),c.contextTypes&&(
|
|
29
|
-
null!==f&&(b.type.compare||
|
|
30
|
-
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"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)d=this._newState,"function"!==typeof a.getDerivedStateFromProps&&
|
|
31
|
-
this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),d!==this._newState&&(this._instance.state=this._newState||
|
|
32
|
-
this._instance.componentWillReceiveProps(d,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(d,c));var g=this._newState||b;if("function"===typeof a.getDerivedStateFromProps){var h=a.getDerivedStateFromProps.call(null,d,g);null!=h&&(g=k({},g,h))}h=!0;this._forcedUpdate?(h=!0,this._forcedUpdate=!1):"function"===
|
|
33
|
-
(h=!
|
|
34
|
-
|
|
35
|
-
var
|
|
17
|
+
this._renderer._context))};return a}();function N(){return{memoizedState:null,queue:null,next:null}}function O(a,b){return"function"===typeof b?b(a):b}
|
|
18
|
+
var R=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 M(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};a.prototype._validateCurrentlyRenderingComponent=function(){if(!this._rendering||
|
|
19
|
+
this._instance)throw p(Error(321));};a.prototype._createDispatcher=function(){function b(){c._validateCurrentlyRenderingComponent()}function a(b,a,d){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var f=c._workInProgressHook;if(c._isReRender){d=f.queue;a=d.dispatch;if(0<c._numberOfReRenders){if(null!==c._renderPhaseUpdates){var e=c._renderPhaseUpdates.get(d);if(void 0!==e){c._renderPhaseUpdates.delete(d);d=f.memoizedState;do d=b(d,e.action),e=e.next;while(null!==e);f.memoizedState=
|
|
20
|
+
d;return[d,a]}}return[f.memoizedState,a]}e=f.memoizedState;var g=d.first;if(null!==g){do e=b(e,g.action),g=g.next;while(null!==g);d.first=null;f.memoizedState=e}return[e,a]}b=b===O?"function"===typeof a?a():a:void 0!==d?d(a):a;f.memoizedState=b;b=f.queue={first:null,dispatch:null};b=b.dispatch=c._dispatchAction.bind(c,b);return[f.memoizedState,b]}var c=this;return{readContext:function(b){return b._currentValue},useCallback:function(b){return b},useContext:function(b){c._validateCurrentlyRenderingComponent();
|
|
21
|
+
return b._currentValue},useDebugValue:b,useEffect:b,useImperativeHandle:b,useLayoutEffect:b,useMemo:function(b,a){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();a=void 0!==a?a:null;if(null!==c._workInProgressHook&&null!==c._workInProgressHook.memoizedState){var d=c._workInProgressHook.memoizedState,f=d[1];if(null!==a){a:if(null===f)f=!1;else{for(var e=0;e<f.length&&e<a.length;e++)if(!F(a[e],f[e])){f=!1;break a}f=!0}if(f)return d[0]}}b=b();c._workInProgressHook.memoizedState=
|
|
22
|
+
[b,a];return b},useReducer:a,useRef:function(b){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var a=c._workInProgressHook.memoizedState;return null===a?(b={current:b},c._workInProgressHook.memoizedState=b):a},useState:function(b){return a(O,b)},useResponder:function(b,a){return{props:a,responder:b}}}};a.prototype._dispatchAction=function(b,a){if(!(25>this._numberOfReRenders))throw p(Error(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};
|
|
23
|
+
var c=this._renderPhaseUpdates;null===c&&(this._renderPhaseUpdates=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=
|
|
24
|
+
N()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=N()):(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,
|
|
25
|
+
a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:L;if(!l.isValidElement(b))throw p(Error(12),"function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");if("string"===typeof b.type)throw p(Error(13),
|
|
26
|
+
b.type);if(!m.isForwardRef(b)&&"function"!==typeof b.type&&!m.isMemo(b.type))throw p(Error(249),Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){null!=this._element&&this._element.type!==b.type&&this._reset();var c=m.isMemo(b.type)?b.type.type:b.type,f=this._element;this._rendering=!0;this._element=b;var e;if((e=c.contextTypes)&&a){var g={},h;for(h in e)g[h]=a[h];e=g}else e=L;this._context=e;m.isMemo(b.type)&&c.propTypes&&(P=b,n(c.propTypes,b.props,"prop",E(c),
|
|
27
|
+
Q));if(this._instance)this._updateClassComponent(c,b,this._context);else if(c.prototype&&c.prototype.isReactComponent)this._instance=new c(b.props,this._context,this._updater),"function"===typeof c.getDerivedStateFromProps&&(a=c.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=k({},this._instance.state,a))),c.contextTypes&&(P=b,a=(a=this._instance)&&a.constructor,n(c.contextTypes,this._context,"context",c.displayName||a&&a.displayName||c.name||a&&a.name||
|
|
28
|
+
null,Q),P=null),this._mountClassComponent(c,b,this._context);else if(e=!0,m.isMemo(b.type)&&null!==f&&(b.type.compare||H)(f.props,b.props)&&(e=!1),e){f=K.current;K.current=this._dispatcher;try{if(c.$$typeof===m.ForwardRef){if("function"!==typeof c.render)throw p(Error(322),typeof c.render);this._rendered=c.render.call(void 0,b.props,b.ref)}else this._rendered=c(b.props,this._context)}finally{K.current=f}this._finishHooks(b,a)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};
|
|
29
|
+
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"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)d=this._newState,"function"!==typeof a.getDerivedStateFromProps&&
|
|
30
|
+
"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||L);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d,c){d=d.props;var b=this._instance.state||L,e=this._instance.props;e!==d&&"function"!==typeof a.getDerivedStateFromProps&&
|
|
31
|
+
"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 g=this._newState||b;if("function"===typeof a.getDerivedStateFromProps){var h=a.getDerivedStateFromProps.call(null,d,g);null!=h&&(g=k({},g,h))}h=!0;this._forcedUpdate?(h=!0,this._forcedUpdate=!1):"function"===
|
|
32
|
+
typeof this._instance.shouldComponentUpdate?h=!!this._instance.shouldComponentUpdate(d,g,c):a.prototype&&a.prototype.isPureReactComponent&&(h=!H(e,d)||!H(b,g));h&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(d,g,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(d,g,c));this._instance.context=
|
|
33
|
+
c;this._instance.props=d;this._instance.state=g;this._newState=null;h&&(this._rendered=this._instance.render())};return a}();R.createRenderer=function(){return new R};var P=null;function S(a){if(null==a)return"#empty";if("string"===typeof a||"number"===typeof a)return"#text";if("string"===typeof a.type)return a.type;a=m.isMemo(a.type)?a.type.type:a.type;return a.displayName||a.name||"Unknown"}
|
|
34
|
+
function Q(){var a="";if(P){var b=S(P),d=P._owner,c=P._source;d=d&&E(d.type);var f="";c?f=" (at "+c.fileName.replace(q,"")+":"+c.lineNumber+")":d&&(f=" (created by "+d+")");a+="\n in "+(b||"Unknown")+f}return a}var T={default:R},U=T&&R||T;module.exports=U.default||U;
|