react-test-renderer 16.4.2 → 16.5.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/cjs/react-test-renderer-shallow.development.js +212 -24
- package/cjs/react-test-renderer-shallow.production.min.js +18 -17
- package/cjs/react-test-renderer.development.js +2929 -1809
- package/cjs/react-test-renderer.production.min.js +123 -112
- package/package.json +4 -4
- package/umd/react-test-renderer-shallow.development.js +160 -173
- package/umd/react-test-renderer-shallow.production.min.js +13 -13
- package/umd/react-test-renderer.development.js +2896 -1964
- package/umd/react-test-renderer.production.min.js +103 -93
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.5.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -16,20 +16,127 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
|
-
var invariant = require('fbjs/lib/invariant');
|
|
20
19
|
var React = require('react');
|
|
21
20
|
var reactIs = require('react-is');
|
|
22
|
-
var emptyObject = require('fbjs/lib/emptyObject');
|
|
23
|
-
var shallowEqual = require('fbjs/lib/shallowEqual');
|
|
24
21
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
25
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
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
|
+
*/
|
|
33
|
+
|
|
34
|
+
var validateFormat = function () {};
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
validateFormat = function (format) {
|
|
38
|
+
if (format === undefined) {
|
|
39
|
+
throw new Error('invariant requires an error message argument');
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
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
|
+
|
|
26
65
|
// Relying on the `invariant()` implementation lets us
|
|
27
|
-
//
|
|
66
|
+
// preserve the format and params in the www builds.
|
|
67
|
+
|
|
68
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
28
69
|
|
|
29
70
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
30
|
-
|
|
71
|
+
var sourceInfo = '';
|
|
72
|
+
if (source) {
|
|
73
|
+
var path = source.fileName;
|
|
74
|
+
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
75
|
+
{
|
|
76
|
+
// In DEV, include code for a common special case:
|
|
77
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
78
|
+
if (/^index\./.test(fileName)) {
|
|
79
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
80
|
+
if (match) {
|
|
81
|
+
var pathBeforeSlash = match[1];
|
|
82
|
+
if (pathBeforeSlash) {
|
|
83
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
84
|
+
fileName = folderName + '/' + fileName;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
90
|
+
} else if (ownerName) {
|
|
91
|
+
sourceInfo = ' (created by ' + ownerName + ')';
|
|
92
|
+
}
|
|
93
|
+
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
31
94
|
};
|
|
32
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
98
|
+
* This can be used to log issues in development environments in critical
|
|
99
|
+
* paths. Removing the logging code for production environments will keep the
|
|
100
|
+
* same logic and follow the same code paths.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
var warningWithoutStack = function () {};
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
warningWithoutStack = function (condition, format) {
|
|
107
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
108
|
+
args[_key - 2] = arguments[_key];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (format === undefined) {
|
|
112
|
+
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
113
|
+
}
|
|
114
|
+
if (condition) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (typeof console !== 'undefined') {
|
|
118
|
+
var _console;
|
|
119
|
+
|
|
120
|
+
var stringArgs = args.map(function (item) {
|
|
121
|
+
return '' + item;
|
|
122
|
+
});
|
|
123
|
+
(_console = console).error.apply(_console, ['Warning: ' + format].concat(stringArgs));
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
// --- Welcome to debugging React ---
|
|
127
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
128
|
+
// to find the callsite that caused this warning to fire.
|
|
129
|
+
var argIndex = 0;
|
|
130
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
131
|
+
return args[argIndex++];
|
|
132
|
+
});
|
|
133
|
+
throw new Error(message);
|
|
134
|
+
} catch (x) {}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var warningWithoutStack$1 = warningWithoutStack;
|
|
139
|
+
|
|
33
140
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
34
141
|
// nor polyfill, then a plain number is used for performance.
|
|
35
142
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
@@ -43,13 +150,29 @@ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
|
43
150
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
44
151
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
45
152
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
46
|
-
var
|
|
153
|
+
var REACT_PLACEHOLDER_TYPE = hasSymbol ? Symbol.for('react.placeholder') : 0xead1;
|
|
154
|
+
|
|
155
|
+
var Resolved = 1;
|
|
156
|
+
|
|
157
|
+
|
|
47
158
|
|
|
48
|
-
function getComponentName(fiber) {
|
|
49
|
-
var type = fiber.type;
|
|
50
159
|
|
|
160
|
+
function refineResolvedThenable(thenable) {
|
|
161
|
+
return thenable._reactStatus === Resolved ? thenable._reactResult : null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function getComponentName(type) {
|
|
165
|
+
if (type == null) {
|
|
166
|
+
// Host root, text node or just invalid type.
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
{
|
|
170
|
+
if (typeof type.tag === 'number') {
|
|
171
|
+
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
51
174
|
if (typeof type === 'function') {
|
|
52
|
-
return type.displayName || type.name;
|
|
175
|
+
return type.displayName || type.name || null;
|
|
53
176
|
}
|
|
54
177
|
if (typeof type === 'string') {
|
|
55
178
|
return type;
|
|
@@ -57,33 +180,98 @@ function getComponentName(fiber) {
|
|
|
57
180
|
switch (type) {
|
|
58
181
|
case REACT_ASYNC_MODE_TYPE:
|
|
59
182
|
return 'AsyncMode';
|
|
60
|
-
case REACT_CONTEXT_TYPE:
|
|
61
|
-
return 'Context.Consumer';
|
|
62
183
|
case REACT_FRAGMENT_TYPE:
|
|
63
|
-
return '
|
|
184
|
+
return 'Fragment';
|
|
64
185
|
case REACT_PORTAL_TYPE:
|
|
65
|
-
return '
|
|
186
|
+
return 'Portal';
|
|
66
187
|
case REACT_PROFILER_TYPE:
|
|
67
|
-
return 'Profiler
|
|
68
|
-
case REACT_PROVIDER_TYPE:
|
|
69
|
-
return 'Context.Provider';
|
|
188
|
+
return 'Profiler';
|
|
70
189
|
case REACT_STRICT_MODE_TYPE:
|
|
71
190
|
return 'StrictMode';
|
|
72
|
-
case
|
|
73
|
-
return '
|
|
191
|
+
case REACT_PLACEHOLDER_TYPE:
|
|
192
|
+
return 'Placeholder';
|
|
74
193
|
}
|
|
75
|
-
if (typeof type === 'object'
|
|
194
|
+
if (typeof type === 'object') {
|
|
76
195
|
switch (type.$$typeof) {
|
|
196
|
+
case REACT_CONTEXT_TYPE:
|
|
197
|
+
return 'Context.Consumer';
|
|
198
|
+
case REACT_PROVIDER_TYPE:
|
|
199
|
+
return 'Context.Provider';
|
|
77
200
|
case REACT_FORWARD_REF_TYPE:
|
|
78
|
-
var
|
|
201
|
+
var renderFn = type.render;
|
|
202
|
+
var functionName = renderFn.displayName || renderFn.name || '';
|
|
79
203
|
return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
|
|
80
204
|
}
|
|
205
|
+
if (typeof type.then === 'function') {
|
|
206
|
+
var thenable = type;
|
|
207
|
+
var resolvedThenable = refineResolvedThenable(thenable);
|
|
208
|
+
if (resolvedThenable) {
|
|
209
|
+
return getComponentName(resolvedThenable);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
81
212
|
}
|
|
82
213
|
return null;
|
|
83
214
|
}
|
|
84
215
|
|
|
216
|
+
/*eslint-disable no-self-compare */
|
|
217
|
+
|
|
218
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
222
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
223
|
+
*/
|
|
224
|
+
function is(x, y) {
|
|
225
|
+
// SameValue algorithm
|
|
226
|
+
if (x === y) {
|
|
227
|
+
// Steps 1-5, 7-10
|
|
228
|
+
// Steps 6.b-6.e: +0 != -0
|
|
229
|
+
// Added the nonzero y check to make Flow happy, but it is redundant
|
|
230
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
231
|
+
} else {
|
|
232
|
+
// Step 6.a: NaN == NaN
|
|
233
|
+
return x !== x && y !== y;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Performs equality by iterating through keys on an object and returning false
|
|
239
|
+
* when any key has values which are not strictly equal between the arguments.
|
|
240
|
+
* Returns true when the values of all keys are strictly equal.
|
|
241
|
+
*/
|
|
242
|
+
function shallowEqual(objA, objB) {
|
|
243
|
+
if (is(objA, objB)) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
var keysA = Object.keys(objA);
|
|
252
|
+
var keysB = Object.keys(objB);
|
|
253
|
+
|
|
254
|
+
if (keysA.length !== keysB.length) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Test for A's keys different from B.
|
|
259
|
+
for (var i = 0; i < keysA.length; i++) {
|
|
260
|
+
if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
|
|
85
268
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
86
269
|
|
|
270
|
+
var emptyObject = {};
|
|
271
|
+
{
|
|
272
|
+
Object.freeze(emptyObject);
|
|
273
|
+
}
|
|
274
|
+
|
|
87
275
|
var ReactShallowRenderer = function () {
|
|
88
276
|
function ReactShallowRenderer() {
|
|
89
277
|
_classCallCheck(this, ReactShallowRenderer);
|
|
@@ -142,7 +330,7 @@ var ReactShallowRenderer = function () {
|
|
|
142
330
|
|
|
143
331
|
this._mountClassComponent(element, this._context);
|
|
144
332
|
} else {
|
|
145
|
-
this._rendered = element.type(element.props, this._context);
|
|
333
|
+
this._rendered = element.type.call(undefined, element.props, this._context);
|
|
146
334
|
}
|
|
147
335
|
}
|
|
148
336
|
|
|
@@ -363,7 +551,7 @@ function getStackAddendum() {
|
|
|
363
551
|
if (currentlyValidatingElement) {
|
|
364
552
|
var name = getDisplayName(currentlyValidatingElement);
|
|
365
553
|
var owner = currentlyValidatingElement._owner;
|
|
366
|
-
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
|
|
554
|
+
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
367
555
|
}
|
|
368
556
|
return stack;
|
|
369
557
|
}
|
|
@@ -398,7 +586,7 @@ var ReactShallowRenderer$3 = ( ReactShallowRenderer$2 && ReactShallowRenderer )
|
|
|
398
586
|
|
|
399
587
|
// TODO: decide on the top-level export form.
|
|
400
588
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
401
|
-
var shallow = ReactShallowRenderer$3.default
|
|
589
|
+
var shallow = ReactShallowRenderer$3.default || ReactShallowRenderer$3;
|
|
402
590
|
|
|
403
591
|
module.exports = shallow;
|
|
404
592
|
})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.5.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -7,19 +7,20 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var e=require("object-assign"),
|
|
11
|
-
function r(
|
|
12
|
-
var t="function"===typeof Symbol&&Symbol.for,u
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this._renderer._context)
|
|
10
|
+
'use strict';var e=require("object-assign"),g=require("react"),n=require("react-is"),p=require("prop-types/checkPropTypes");function q(a,b,c,d,f,h,m,k){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 l=[c,d,f,h,m,k],D=0;a=Error(b.replace(/%s/g,function(){return l[D++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
|
11
|
+
function r(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;d<b;d++)c+="&args[]="+encodeURIComponent(arguments[d+1]);q(!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. ",c)}
|
|
12
|
+
var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.async_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.placeholder"):60113;
|
|
13
|
+
function F(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 B:return"AsyncMode";case w:return"Fragment";case v:return"Portal";case y:return"Profiler";case x:return"StrictMode";case E:return"Placeholder"}if("object"===typeof a){switch(a.$$typeof){case A:return"Context.Consumer";case z:return"Context.Provider";case C:return a=a.render,a=a.displayName||a.name||"",""!==a?"ForwardRef("+a+")":"ForwardRef"}if("function"===
|
|
14
|
+
typeof a.then&&(a=1===a._reactStatus?a._reactResult:null))return F(a)}return null}var G=Object.prototype.hasOwnProperty;function H(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function I(a,b){if(H(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!G.call(b,c[d])||!H(a[c[d]],b[c[d]]))return!1;return!0}
|
|
15
|
+
function J(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
|
|
16
|
+
var K={},O=function(){function a(){J(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new L(this)}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]:K;g.isValidElement(b)?void 0:r("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
|
|
17
|
+
"");"string"===typeof b.type?r("13",b.type):void 0;n.isForwardRef(b)||"function"===typeof b.type?void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var d=b.type.contextTypes;if(d){var f={},h;for(h in d)f[h]=a[h];a=f}else a=K;this._context=a;this._instance?this._updateClassComponent(b,this._context):n.isForwardRef(b)?this._rendered=b.type.render(b.props,b.ref):(a=b.type,a.prototype&&a.prototype.isReactComponent?(this._instance=
|
|
18
|
+
new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes")&&(M=b,a=b.type,d=(d=this._instance)&&d.constructor,p(b.type.contextTypes,this._context,"context",a.displayName||d&&d.displayName||a.name||d&&d.name||null,N),M=null),this._mountClassComponent(b,this._context)):this._rendered=b.type.call(void 0,b.props,this._context));this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=
|
|
19
|
+
function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._instance=this._rendered=this._newState=this._element=this._context=null};a.prototype._mountClassComponent=function(a,c){this._instance.context=c;this._instance.props=a.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)c=
|
|
20
|
+
this._newState,"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),c!==this._newState&&(this._instance.state=this._newState||K);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,c){var b=a.props,f=a.type,h=this._instance.state||
|
|
21
|
+
K,m=this._instance.props;m!==b&&"function"!==typeof a.type.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));this._updateStateFromStaticLifecycle(b);var k=this._newState||h,l=!0;this._forcedUpdate?(l=!0,this._forcedUpdate=!1):"function"===
|
|
22
|
+
typeof this._instance.shouldComponentUpdate?l=!!this._instance.shouldComponentUpdate(b,k,c):f.prototype&&f.prototype.isPureReactComponent&&(l=!I(m,b)||!I(h,k));l&&"function"!==typeof a.type.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,k,c));this._instance.context=
|
|
23
|
+
c;this._instance.props=b;this._instance.state=k;l&&(this._rendered=this._instance.render())};a.prototype._updateStateFromStaticLifecycle=function(a){var b=this._element.type;if("function"===typeof b.getDerivedStateFromProps){var d=this._newState||this._instance.state;a=b.getDerivedStateFromProps.call(null,a,d);null!=a&&(d=e({},d,a),this._instance.state=this._newState=d)}};return a}();O.createRenderer=function(){return new O};
|
|
24
|
+
var L=function(){function a(b){J(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(a,c){"function"===typeof a&&c&&this._callbacks.push({callback:a,publicInstance:c})};a.prototype._invokeCallbacks=function(){var a=this._callbacks;this._callbacks=[];a.forEach(function(a){a.callback.call(a.publicInstance)})};a.prototype.isMounted=function(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(a,c){this._enqueueCallback(c,a);this._renderer._forcedUpdate=
|
|
25
|
+
!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(a,c,d){this._enqueueCallback(d,a);this._renderer._newState=c;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(a,c,d){this._enqueueCallback(d,a);d=this._renderer._newState||a.state;"function"===typeof c&&(c=c.call(a,d,a.props));null!==c&&void 0!==c&&(this._renderer._newState=e({},d,c),this._renderer.render(this._renderer._element,
|
|
26
|
+
this._renderer._context))};return a}(),M=null;function N(){var a="";if(M){var b=null==M?"#empty":"string"===typeof M||"number"===typeof M?"#text":"string"===typeof M.type?M.type:M.type.displayName||M.type.name||"Unknown",c=M._owner,d=M._source;c=c&&F(c.type);var f="";d?f=" (at "+d.fileName.replace(t,"")+":"+d.lineNumber+")":c&&(f=" (created by "+c+")");a+="\n in "+(b||"Unknown")+f}return a}var P={default:O},Q=P&&O||P;module.exports=Q.default||Q;
|