react 0.0.0-fec00a869 → 0.0.0-f6b8d31a7
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.development.js +677 -260
- package/cjs/react.production.min.js +16 -16
- package/package.json +2 -3
- package/umd/react.development.js +2983 -2189
- package/umd/react.production.min.js +26 -25
- package/umd/react.profiling.min.js +33 -30
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"branch": "master",
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
3
|
+
"buildNumber": "54692",
|
|
4
|
+
"checksum": "2b60c86",
|
|
5
|
+
"commit": "f6b8d31a7",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.11.0-f6b8d31a7"
|
|
8
8
|
}
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-
|
|
1
|
+
/** @license React v0.0.0-f6b8d31a7
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -20,40 +20,50 @@ var checkPropTypes = require('prop-types/checkPropTypes');
|
|
|
20
20
|
|
|
21
21
|
// TODO: this is special because it gets imported during build.
|
|
22
22
|
|
|
23
|
-
var ReactVersion = '16.
|
|
23
|
+
var ReactVersion = '16.11.0-f6b8d31a7';
|
|
24
24
|
|
|
25
25
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
26
26
|
// nor polyfill, then a plain number is used for performance.
|
|
27
27
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
28
|
-
|
|
29
28
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
30
29
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
31
30
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
32
31
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
33
32
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
34
33
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
35
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
34
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
35
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
36
|
+
|
|
36
37
|
|
|
37
38
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
38
39
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
39
40
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
41
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
40
42
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
41
43
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
42
|
-
|
|
44
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
45
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
46
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
43
47
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
44
48
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
45
|
-
|
|
46
49
|
function getIteratorFn(maybeIterable) {
|
|
47
50
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
48
51
|
return null;
|
|
49
52
|
}
|
|
53
|
+
|
|
50
54
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
55
|
+
|
|
51
56
|
if (typeof maybeIterator === 'function') {
|
|
52
57
|
return maybeIterator;
|
|
53
58
|
}
|
|
59
|
+
|
|
54
60
|
return null;
|
|
55
61
|
}
|
|
56
62
|
|
|
63
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
64
|
+
// template literal strings. The messages will be replaced with error codes
|
|
65
|
+
// during build.
|
|
66
|
+
|
|
57
67
|
/**
|
|
58
68
|
* Use invariant() to assert state which your program assumes to be true.
|
|
59
69
|
*
|
|
@@ -65,40 +75,6 @@ function getIteratorFn(maybeIterable) {
|
|
|
65
75
|
* will remain to ensure logic does not differ in production.
|
|
66
76
|
*/
|
|
67
77
|
|
|
68
|
-
var validateFormat = function () {};
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
validateFormat = function (format) {
|
|
72
|
-
if (format === undefined) {
|
|
73
|
-
throw new Error('invariant requires an error message argument');
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function invariant(condition, format, a, b, c, d, e, f) {
|
|
79
|
-
validateFormat(format);
|
|
80
|
-
|
|
81
|
-
if (!condition) {
|
|
82
|
-
var error = void 0;
|
|
83
|
-
if (format === undefined) {
|
|
84
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
85
|
-
} else {
|
|
86
|
-
var args = [a, b, c, d, e, f];
|
|
87
|
-
var argIndex = 0;
|
|
88
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
89
|
-
return args[argIndex++];
|
|
90
|
-
}));
|
|
91
|
-
error.name = 'Invariant Violation';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Relying on the `invariant()` implementation lets us
|
|
100
|
-
// preserve the format and params in the www builds.
|
|
101
|
-
|
|
102
78
|
/**
|
|
103
79
|
* Forked from fbjs/warning:
|
|
104
80
|
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
@@ -112,12 +88,11 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
112
88
|
* paths. Removing the logging code for production environments will keep the
|
|
113
89
|
* same logic and follow the same code paths.
|
|
114
90
|
*/
|
|
115
|
-
|
|
116
|
-
var lowPriorityWarning = function () {};
|
|
91
|
+
var lowPriorityWarningWithoutStack = function () {};
|
|
117
92
|
|
|
118
93
|
{
|
|
119
94
|
var printWarning = function (format) {
|
|
120
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
95
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
121
96
|
args[_key - 1] = arguments[_key];
|
|
122
97
|
}
|
|
123
98
|
|
|
@@ -125,9 +100,11 @@ var lowPriorityWarning = function () {};
|
|
|
125
100
|
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
126
101
|
return args[argIndex++];
|
|
127
102
|
});
|
|
103
|
+
|
|
128
104
|
if (typeof console !== 'undefined') {
|
|
129
105
|
console.warn(message);
|
|
130
106
|
}
|
|
107
|
+
|
|
131
108
|
try {
|
|
132
109
|
// --- Welcome to debugging React ---
|
|
133
110
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -136,21 +113,22 @@ var lowPriorityWarning = function () {};
|
|
|
136
113
|
} catch (x) {}
|
|
137
114
|
};
|
|
138
115
|
|
|
139
|
-
|
|
116
|
+
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
140
117
|
if (format === undefined) {
|
|
141
|
-
throw new Error('`
|
|
118
|
+
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
142
119
|
}
|
|
120
|
+
|
|
143
121
|
if (!condition) {
|
|
144
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
122
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
145
123
|
args[_key2 - 2] = arguments[_key2];
|
|
146
124
|
}
|
|
147
125
|
|
|
148
|
-
printWarning.apply(
|
|
126
|
+
printWarning.apply(void 0, [format].concat(args));
|
|
149
127
|
}
|
|
150
128
|
};
|
|
151
129
|
}
|
|
152
130
|
|
|
153
|
-
var
|
|
131
|
+
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
154
132
|
|
|
155
133
|
/**
|
|
156
134
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
@@ -158,35 +136,37 @@ var lowPriorityWarning$1 = lowPriorityWarning;
|
|
|
158
136
|
* paths. Removing the logging code for production environments will keep the
|
|
159
137
|
* same logic and follow the same code paths.
|
|
160
138
|
*/
|
|
161
|
-
|
|
162
139
|
var warningWithoutStack = function () {};
|
|
163
140
|
|
|
164
141
|
{
|
|
165
142
|
warningWithoutStack = function (condition, format) {
|
|
166
|
-
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
143
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
167
144
|
args[_key - 2] = arguments[_key];
|
|
168
145
|
}
|
|
169
146
|
|
|
170
147
|
if (format === undefined) {
|
|
171
148
|
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
172
149
|
}
|
|
150
|
+
|
|
173
151
|
if (args.length > 8) {
|
|
174
152
|
// Check before the condition to catch violations early.
|
|
175
153
|
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
|
176
154
|
}
|
|
155
|
+
|
|
177
156
|
if (condition) {
|
|
178
157
|
return;
|
|
179
158
|
}
|
|
159
|
+
|
|
180
160
|
if (typeof console !== 'undefined') {
|
|
181
161
|
var argsWithFormat = args.map(function (item) {
|
|
182
162
|
return '' + item;
|
|
183
163
|
});
|
|
184
|
-
argsWithFormat.unshift('Warning: ' + format);
|
|
185
|
-
|
|
186
|
-
// We intentionally don't use spread (or .apply) directly because it
|
|
164
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
187
165
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
166
|
+
|
|
188
167
|
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
|
189
168
|
}
|
|
169
|
+
|
|
190
170
|
try {
|
|
191
171
|
// --- Welcome to debugging React ---
|
|
192
172
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -208,18 +188,21 @@ function warnNoop(publicInstance, callerName) {
|
|
|
208
188
|
{
|
|
209
189
|
var _constructor = publicInstance.constructor;
|
|
210
190
|
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
211
|
-
var warningKey = componentName +
|
|
191
|
+
var warningKey = componentName + "." + callerName;
|
|
192
|
+
|
|
212
193
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
213
194
|
return;
|
|
214
195
|
}
|
|
196
|
+
|
|
215
197
|
warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
216
198
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
217
199
|
}
|
|
218
200
|
}
|
|
219
|
-
|
|
220
201
|
/**
|
|
221
202
|
* This is the abstract API for an update queue.
|
|
222
203
|
*/
|
|
204
|
+
|
|
205
|
+
|
|
223
206
|
var ReactNoopUpdateQueue = {
|
|
224
207
|
/**
|
|
225
208
|
* Checks whether or not this composite component is mounted.
|
|
@@ -286,25 +269,26 @@ var ReactNoopUpdateQueue = {
|
|
|
286
269
|
};
|
|
287
270
|
|
|
288
271
|
var emptyObject = {};
|
|
272
|
+
|
|
289
273
|
{
|
|
290
274
|
Object.freeze(emptyObject);
|
|
291
275
|
}
|
|
292
|
-
|
|
293
276
|
/**
|
|
294
277
|
* Base class helpers for the updating state of a component.
|
|
295
278
|
*/
|
|
279
|
+
|
|
280
|
+
|
|
296
281
|
function Component(props, context, updater) {
|
|
297
282
|
this.props = props;
|
|
298
|
-
this.context = context;
|
|
299
|
-
|
|
300
|
-
this.refs = emptyObject;
|
|
301
|
-
// We initialize the default updater but the real one gets injected by the
|
|
283
|
+
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
284
|
+
|
|
285
|
+
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
|
|
302
286
|
// renderer.
|
|
287
|
+
|
|
303
288
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
304
289
|
}
|
|
305
290
|
|
|
306
291
|
Component.prototype.isReactComponent = {};
|
|
307
|
-
|
|
308
292
|
/**
|
|
309
293
|
* Sets a subset of the state. Always use this to mutate
|
|
310
294
|
* state. You should treat `this.state` as immutable.
|
|
@@ -330,11 +314,16 @@ Component.prototype.isReactComponent = {};
|
|
|
330
314
|
* @final
|
|
331
315
|
* @protected
|
|
332
316
|
*/
|
|
317
|
+
|
|
333
318
|
Component.prototype.setState = function (partialState, callback) {
|
|
334
|
-
!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)
|
|
319
|
+
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
320
|
+
{
|
|
321
|
+
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
335
325
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
336
326
|
};
|
|
337
|
-
|
|
338
327
|
/**
|
|
339
328
|
* Forces an update. This should only be invoked when it is known with
|
|
340
329
|
* certainty that we are **not** in a DOM transaction.
|
|
@@ -349,28 +338,33 @@ Component.prototype.setState = function (partialState, callback) {
|
|
|
349
338
|
* @final
|
|
350
339
|
* @protected
|
|
351
340
|
*/
|
|
341
|
+
|
|
342
|
+
|
|
352
343
|
Component.prototype.forceUpdate = function (callback) {
|
|
353
344
|
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
354
345
|
};
|
|
355
|
-
|
|
356
346
|
/**
|
|
357
347
|
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
358
348
|
* we would like to deprecate them, we're not going to move them over to this
|
|
359
349
|
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
360
350
|
*/
|
|
351
|
+
|
|
352
|
+
|
|
361
353
|
{
|
|
362
354
|
var deprecatedAPIs = {
|
|
363
355
|
isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
|
364
356
|
replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
|
365
357
|
};
|
|
358
|
+
|
|
366
359
|
var defineDeprecationWarning = function (methodName, info) {
|
|
367
360
|
Object.defineProperty(Component.prototype, methodName, {
|
|
368
361
|
get: function () {
|
|
369
|
-
|
|
362
|
+
lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
370
363
|
return undefined;
|
|
371
364
|
}
|
|
372
365
|
});
|
|
373
366
|
};
|
|
367
|
+
|
|
374
368
|
for (var fnName in deprecatedAPIs) {
|
|
375
369
|
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
376
370
|
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
@@ -379,23 +373,25 @@ Component.prototype.forceUpdate = function (callback) {
|
|
|
379
373
|
}
|
|
380
374
|
|
|
381
375
|
function ComponentDummy() {}
|
|
382
|
-
ComponentDummy.prototype = Component.prototype;
|
|
383
376
|
|
|
377
|
+
ComponentDummy.prototype = Component.prototype;
|
|
384
378
|
/**
|
|
385
379
|
* Convenience component with default shallow equality check for sCU.
|
|
386
380
|
*/
|
|
381
|
+
|
|
387
382
|
function PureComponent(props, context, updater) {
|
|
388
383
|
this.props = props;
|
|
389
|
-
this.context = context;
|
|
390
|
-
|
|
384
|
+
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
385
|
+
|
|
391
386
|
this.refs = emptyObject;
|
|
392
387
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
393
388
|
}
|
|
394
389
|
|
|
395
390
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
396
|
-
pureComponentPrototype.constructor = PureComponent;
|
|
397
|
-
|
|
391
|
+
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
392
|
+
|
|
398
393
|
_assign(pureComponentPrototype, Component.prototype);
|
|
394
|
+
|
|
399
395
|
pureComponentPrototype.isPureReactComponent = true;
|
|
400
396
|
|
|
401
397
|
// an immutable object with a single mutable value
|
|
@@ -403,9 +399,11 @@ function createRef() {
|
|
|
403
399
|
var refObject = {
|
|
404
400
|
current: null
|
|
405
401
|
};
|
|
402
|
+
|
|
406
403
|
{
|
|
407
404
|
Object.seal(refObject);
|
|
408
405
|
}
|
|
406
|
+
|
|
409
407
|
return refObject;
|
|
410
408
|
}
|
|
411
409
|
|
|
@@ -420,6 +418,14 @@ var ReactCurrentDispatcher = {
|
|
|
420
418
|
current: null
|
|
421
419
|
};
|
|
422
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Keeps track of the current batch's configuration such as how long an update
|
|
423
|
+
* should suspend for if it needs to.
|
|
424
|
+
*/
|
|
425
|
+
var ReactCurrentBatchConfig = {
|
|
426
|
+
suspense: null
|
|
427
|
+
};
|
|
428
|
+
|
|
423
429
|
/**
|
|
424
430
|
* Keeps track of the current owner.
|
|
425
431
|
*
|
|
@@ -435,19 +441,22 @@ var ReactCurrentOwner = {
|
|
|
435
441
|
};
|
|
436
442
|
|
|
437
443
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
438
|
-
|
|
439
444
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
440
445
|
var sourceInfo = '';
|
|
446
|
+
|
|
441
447
|
if (source) {
|
|
442
448
|
var path = source.fileName;
|
|
443
449
|
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
450
|
+
|
|
444
451
|
{
|
|
445
452
|
// In DEV, include code for a common special case:
|
|
446
453
|
// prefer "folder/index.js" instead of just "index.js".
|
|
447
454
|
if (/^index\./.test(fileName)) {
|
|
448
455
|
var match = path.match(BEFORE_SLASH_RE);
|
|
456
|
+
|
|
449
457
|
if (match) {
|
|
450
458
|
var pathBeforeSlash = match[1];
|
|
459
|
+
|
|
451
460
|
if (pathBeforeSlash) {
|
|
452
461
|
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
453
462
|
fileName = folderName + '/' + fileName;
|
|
@@ -455,23 +464,24 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
455
464
|
}
|
|
456
465
|
}
|
|
457
466
|
}
|
|
467
|
+
|
|
458
468
|
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
459
469
|
} else if (ownerName) {
|
|
460
470
|
sourceInfo = ' (created by ' + ownerName + ')';
|
|
461
471
|
}
|
|
472
|
+
|
|
462
473
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
463
474
|
};
|
|
464
475
|
|
|
465
476
|
var Resolved = 1;
|
|
466
477
|
|
|
467
|
-
|
|
468
478
|
function refineResolvedLazyComponent(lazyComponent) {
|
|
469
479
|
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
470
480
|
}
|
|
471
481
|
|
|
472
482
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
473
483
|
var functionName = innerType.displayName || innerType.name || '';
|
|
474
|
-
return outerType.displayName || (functionName !== '' ? wrapperName +
|
|
484
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
475
485
|
}
|
|
476
486
|
|
|
477
487
|
function getComponentName(type) {
|
|
@@ -479,58 +489,74 @@ function getComponentName(type) {
|
|
|
479
489
|
// Host root, text node or just invalid type.
|
|
480
490
|
return null;
|
|
481
491
|
}
|
|
492
|
+
|
|
482
493
|
{
|
|
483
494
|
if (typeof type.tag === 'number') {
|
|
484
495
|
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
485
496
|
}
|
|
486
497
|
}
|
|
498
|
+
|
|
487
499
|
if (typeof type === 'function') {
|
|
488
500
|
return type.displayName || type.name || null;
|
|
489
501
|
}
|
|
502
|
+
|
|
490
503
|
if (typeof type === 'string') {
|
|
491
504
|
return type;
|
|
492
505
|
}
|
|
506
|
+
|
|
493
507
|
switch (type) {
|
|
494
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
495
|
-
return 'ConcurrentMode';
|
|
496
508
|
case REACT_FRAGMENT_TYPE:
|
|
497
509
|
return 'Fragment';
|
|
510
|
+
|
|
498
511
|
case REACT_PORTAL_TYPE:
|
|
499
512
|
return 'Portal';
|
|
513
|
+
|
|
500
514
|
case REACT_PROFILER_TYPE:
|
|
501
|
-
return
|
|
515
|
+
return "Profiler";
|
|
516
|
+
|
|
502
517
|
case REACT_STRICT_MODE_TYPE:
|
|
503
518
|
return 'StrictMode';
|
|
519
|
+
|
|
504
520
|
case REACT_SUSPENSE_TYPE:
|
|
505
521
|
return 'Suspense';
|
|
522
|
+
|
|
523
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
524
|
+
return 'SuspenseList';
|
|
506
525
|
}
|
|
526
|
+
|
|
507
527
|
if (typeof type === 'object') {
|
|
508
528
|
switch (type.$$typeof) {
|
|
509
529
|
case REACT_CONTEXT_TYPE:
|
|
510
530
|
return 'Context.Consumer';
|
|
531
|
+
|
|
511
532
|
case REACT_PROVIDER_TYPE:
|
|
512
533
|
return 'Context.Provider';
|
|
534
|
+
|
|
513
535
|
case REACT_FORWARD_REF_TYPE:
|
|
514
536
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
537
|
+
|
|
515
538
|
case REACT_MEMO_TYPE:
|
|
516
539
|
return getComponentName(type.type);
|
|
540
|
+
|
|
517
541
|
case REACT_LAZY_TYPE:
|
|
518
542
|
{
|
|
519
543
|
var thenable = type;
|
|
520
544
|
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
545
|
+
|
|
521
546
|
if (resolvedThenable) {
|
|
522
547
|
return getComponentName(resolvedThenable);
|
|
523
548
|
}
|
|
549
|
+
|
|
550
|
+
break;
|
|
524
551
|
}
|
|
525
552
|
}
|
|
526
553
|
}
|
|
554
|
+
|
|
527
555
|
return null;
|
|
528
556
|
}
|
|
529
557
|
|
|
530
558
|
var ReactDebugCurrentFrame = {};
|
|
531
|
-
|
|
532
559
|
var currentlyValidatingElement = null;
|
|
533
|
-
|
|
534
560
|
function setCurrentlyValidatingElement(element) {
|
|
535
561
|
{
|
|
536
562
|
currentlyValidatingElement = element;
|
|
@@ -542,17 +568,17 @@ function setCurrentlyValidatingElement(element) {
|
|
|
542
568
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
543
569
|
|
|
544
570
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
545
|
-
var stack = '';
|
|
571
|
+
var stack = ''; // Add an extra top frame while an element is being validated
|
|
546
572
|
|
|
547
|
-
// Add an extra top frame while an element is being validated
|
|
548
573
|
if (currentlyValidatingElement) {
|
|
549
574
|
var name = getComponentName(currentlyValidatingElement.type);
|
|
550
575
|
var owner = currentlyValidatingElement._owner;
|
|
551
576
|
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
552
|
-
}
|
|
577
|
+
} // Delegate to the injected renderer-specific implementation
|
|
578
|
+
|
|
553
579
|
|
|
554
|
-
// Delegate to the injected renderer-specific implementation
|
|
555
580
|
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
581
|
+
|
|
556
582
|
if (impl) {
|
|
557
583
|
stack += impl() || '';
|
|
558
584
|
}
|
|
@@ -561,9 +587,18 @@ function setCurrentlyValidatingElement(element) {
|
|
|
561
587
|
};
|
|
562
588
|
}
|
|
563
589
|
|
|
590
|
+
/**
|
|
591
|
+
* Used by act() to track whether you're inside an act() scope.
|
|
592
|
+
*/
|
|
593
|
+
var IsSomeRendererActing = {
|
|
594
|
+
current: false
|
|
595
|
+
};
|
|
596
|
+
|
|
564
597
|
var ReactSharedInternals = {
|
|
565
598
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
599
|
+
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
566
600
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
601
|
+
IsSomeRendererActing: IsSomeRendererActing,
|
|
567
602
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
568
603
|
assign: _assign
|
|
569
604
|
};
|
|
@@ -592,41 +627,41 @@ var warning = warningWithoutStack$1;
|
|
|
592
627
|
if (condition) {
|
|
593
628
|
return;
|
|
594
629
|
}
|
|
630
|
+
|
|
595
631
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
596
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
597
|
-
// eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
632
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
598
633
|
|
|
599
|
-
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
634
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
600
635
|
args[_key - 2] = arguments[_key];
|
|
601
636
|
}
|
|
602
637
|
|
|
603
|
-
warningWithoutStack$1.apply(
|
|
638
|
+
warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
|
604
639
|
};
|
|
605
640
|
}
|
|
606
641
|
|
|
607
642
|
var warning$1 = warning;
|
|
608
643
|
|
|
609
644
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
610
|
-
|
|
611
645
|
var RESERVED_PROPS = {
|
|
612
646
|
key: true,
|
|
613
647
|
ref: true,
|
|
614
648
|
__self: true,
|
|
615
649
|
__source: true
|
|
616
650
|
};
|
|
617
|
-
|
|
618
|
-
var
|
|
619
|
-
var specialPropRefWarningShown = void 0;
|
|
651
|
+
var specialPropKeyWarningShown;
|
|
652
|
+
var specialPropRefWarningShown;
|
|
620
653
|
|
|
621
654
|
function hasValidRef(config) {
|
|
622
655
|
{
|
|
623
656
|
if (hasOwnProperty.call(config, 'ref')) {
|
|
624
657
|
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
658
|
+
|
|
625
659
|
if (getter && getter.isReactWarning) {
|
|
626
660
|
return false;
|
|
627
661
|
}
|
|
628
662
|
}
|
|
629
663
|
}
|
|
664
|
+
|
|
630
665
|
return config.ref !== undefined;
|
|
631
666
|
}
|
|
632
667
|
|
|
@@ -634,11 +669,13 @@ function hasValidKey(config) {
|
|
|
634
669
|
{
|
|
635
670
|
if (hasOwnProperty.call(config, 'key')) {
|
|
636
671
|
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
672
|
+
|
|
637
673
|
if (getter && getter.isReactWarning) {
|
|
638
674
|
return false;
|
|
639
675
|
}
|
|
640
676
|
}
|
|
641
677
|
}
|
|
678
|
+
|
|
642
679
|
return config.key !== undefined;
|
|
643
680
|
}
|
|
644
681
|
|
|
@@ -649,6 +686,7 @@ function defineKeyPropWarningGetter(props, displayName) {
|
|
|
649
686
|
warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
650
687
|
}
|
|
651
688
|
};
|
|
689
|
+
|
|
652
690
|
warnAboutAccessingKey.isReactWarning = true;
|
|
653
691
|
Object.defineProperty(props, 'key', {
|
|
654
692
|
get: warnAboutAccessingKey,
|
|
@@ -663,22 +701,24 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
663
701
|
warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
|
664
702
|
}
|
|
665
703
|
};
|
|
704
|
+
|
|
666
705
|
warnAboutAccessingRef.isReactWarning = true;
|
|
667
706
|
Object.defineProperty(props, 'ref', {
|
|
668
707
|
get: warnAboutAccessingRef,
|
|
669
708
|
configurable: true
|
|
670
709
|
});
|
|
671
710
|
}
|
|
672
|
-
|
|
673
711
|
/**
|
|
674
712
|
* Factory method to create a new React element. This no longer adheres to
|
|
675
|
-
* the class pattern, so do not use new to call it. Also,
|
|
676
|
-
* will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
713
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
714
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
677
715
|
* if something is a React Element.
|
|
678
716
|
*
|
|
679
717
|
* @param {*} type
|
|
718
|
+
* @param {*} props
|
|
680
719
|
* @param {*} key
|
|
681
720
|
* @param {string|object} ref
|
|
721
|
+
* @param {*} owner
|
|
682
722
|
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
683
723
|
* different from the `owner` when React.createElement is called, so that we
|
|
684
724
|
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
@@ -686,21 +726,19 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
686
726
|
* change in behavior.
|
|
687
727
|
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
688
728
|
* indicating filename, line number, and/or other information.
|
|
689
|
-
* @param {*} owner
|
|
690
|
-
* @param {*} props
|
|
691
729
|
* @internal
|
|
692
730
|
*/
|
|
731
|
+
|
|
732
|
+
|
|
693
733
|
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
694
734
|
var element = {
|
|
695
735
|
// This tag allows us to uniquely identify this as a React Element
|
|
696
736
|
$$typeof: REACT_ELEMENT_TYPE,
|
|
697
|
-
|
|
698
737
|
// Built-in properties that belong on the element
|
|
699
738
|
type: type,
|
|
700
739
|
key: key,
|
|
701
740
|
ref: ref,
|
|
702
741
|
props: props,
|
|
703
|
-
|
|
704
742
|
// Record the component responsible for creating this element.
|
|
705
743
|
_owner: owner
|
|
706
744
|
};
|
|
@@ -710,33 +748,33 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
710
748
|
// an external backing store so that we can freeze the whole object.
|
|
711
749
|
// This can be replaced with a WeakMap once they are implemented in
|
|
712
750
|
// commonly used development environments.
|
|
713
|
-
element._store = {};
|
|
714
|
-
|
|
715
|
-
// To make comparing ReactElements easier for testing purposes, we make
|
|
751
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
716
752
|
// the validation flag non-enumerable (where possible, which should
|
|
717
753
|
// include every environment we run tests in), so the test framework
|
|
718
754
|
// ignores it.
|
|
755
|
+
|
|
719
756
|
Object.defineProperty(element._store, 'validated', {
|
|
720
757
|
configurable: false,
|
|
721
758
|
enumerable: false,
|
|
722
759
|
writable: true,
|
|
723
760
|
value: false
|
|
724
|
-
});
|
|
725
|
-
|
|
761
|
+
}); // self and source are DEV only properties.
|
|
762
|
+
|
|
726
763
|
Object.defineProperty(element, '_self', {
|
|
727
764
|
configurable: false,
|
|
728
765
|
enumerable: false,
|
|
729
766
|
writable: false,
|
|
730
767
|
value: self
|
|
731
|
-
});
|
|
732
|
-
// Two elements created in two different places should be considered
|
|
768
|
+
}); // Two elements created in two different places should be considered
|
|
733
769
|
// equal for testing purposes and therefore we hide it from enumeration.
|
|
770
|
+
|
|
734
771
|
Object.defineProperty(element, '_source', {
|
|
735
772
|
configurable: false,
|
|
736
773
|
enumerable: false,
|
|
737
774
|
writable: false,
|
|
738
775
|
value: source
|
|
739
776
|
});
|
|
777
|
+
|
|
740
778
|
if (Object.freeze) {
|
|
741
779
|
Object.freeze(element.props);
|
|
742
780
|
Object.freeze(element);
|
|
@@ -745,17 +783,87 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
745
783
|
|
|
746
784
|
return element;
|
|
747
785
|
};
|
|
786
|
+
/**
|
|
787
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
788
|
+
* @param {*} type
|
|
789
|
+
* @param {object} props
|
|
790
|
+
* @param {string} key
|
|
791
|
+
*/
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
797
|
+
* @param {*} type
|
|
798
|
+
* @param {object} props
|
|
799
|
+
* @param {string} key
|
|
800
|
+
*/
|
|
801
|
+
|
|
802
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
803
|
+
var propName; // Reserved names are extracted
|
|
804
|
+
|
|
805
|
+
var props = {};
|
|
806
|
+
var key = null;
|
|
807
|
+
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
808
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
809
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
810
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
811
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
812
|
+
// key is explicitly declared to be undefined or not.
|
|
813
|
+
|
|
814
|
+
if (maybeKey !== undefined) {
|
|
815
|
+
key = '' + maybeKey;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (hasValidKey(config)) {
|
|
819
|
+
key = '' + config.key;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
if (hasValidRef(config)) {
|
|
823
|
+
ref = config.ref;
|
|
824
|
+
} // Remaining properties are added to a new props object
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
for (propName in config) {
|
|
828
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
829
|
+
props[propName] = config[propName];
|
|
830
|
+
}
|
|
831
|
+
} // Resolve default props
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
if (type && type.defaultProps) {
|
|
835
|
+
var defaultProps = type.defaultProps;
|
|
836
|
+
|
|
837
|
+
for (propName in defaultProps) {
|
|
838
|
+
if (props[propName] === undefined) {
|
|
839
|
+
props[propName] = defaultProps[propName];
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
748
843
|
|
|
844
|
+
if (key || ref) {
|
|
845
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
846
|
+
|
|
847
|
+
if (key) {
|
|
848
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (ref) {
|
|
852
|
+
defineRefPropWarningGetter(props, displayName);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
857
|
+
}
|
|
749
858
|
/**
|
|
750
859
|
* Create and return a new ReactElement of the given type.
|
|
751
860
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
752
861
|
*/
|
|
862
|
+
|
|
753
863
|
function createElement(type, config, children) {
|
|
754
|
-
var propName
|
|
864
|
+
var propName; // Reserved names are extracted
|
|
755
865
|
|
|
756
|
-
// Reserved names are extracted
|
|
757
866
|
var props = {};
|
|
758
|
-
|
|
759
867
|
var key = null;
|
|
760
868
|
var ref = null;
|
|
761
869
|
var self = null;
|
|
@@ -765,61 +873,70 @@ function createElement(type, config, children) {
|
|
|
765
873
|
if (hasValidRef(config)) {
|
|
766
874
|
ref = config.ref;
|
|
767
875
|
}
|
|
876
|
+
|
|
768
877
|
if (hasValidKey(config)) {
|
|
769
878
|
key = '' + config.key;
|
|
770
879
|
}
|
|
771
880
|
|
|
772
881
|
self = config.__self === undefined ? null : config.__self;
|
|
773
|
-
source = config.__source === undefined ? null : config.__source;
|
|
774
|
-
|
|
882
|
+
source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
|
|
883
|
+
|
|
775
884
|
for (propName in config) {
|
|
776
885
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
777
886
|
props[propName] = config[propName];
|
|
778
887
|
}
|
|
779
888
|
}
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
// Children can be more than one argument, and those are transferred onto
|
|
889
|
+
} // Children can be more than one argument, and those are transferred onto
|
|
783
890
|
// the newly allocated props object.
|
|
891
|
+
|
|
892
|
+
|
|
784
893
|
var childrenLength = arguments.length - 2;
|
|
894
|
+
|
|
785
895
|
if (childrenLength === 1) {
|
|
786
896
|
props.children = children;
|
|
787
897
|
} else if (childrenLength > 1) {
|
|
788
898
|
var childArray = Array(childrenLength);
|
|
899
|
+
|
|
789
900
|
for (var i = 0; i < childrenLength; i++) {
|
|
790
901
|
childArray[i] = arguments[i + 2];
|
|
791
902
|
}
|
|
903
|
+
|
|
792
904
|
{
|
|
793
905
|
if (Object.freeze) {
|
|
794
906
|
Object.freeze(childArray);
|
|
795
907
|
}
|
|
796
908
|
}
|
|
909
|
+
|
|
797
910
|
props.children = childArray;
|
|
798
|
-
}
|
|
911
|
+
} // Resolve default props
|
|
912
|
+
|
|
799
913
|
|
|
800
|
-
// Resolve default props
|
|
801
914
|
if (type && type.defaultProps) {
|
|
802
915
|
var defaultProps = type.defaultProps;
|
|
916
|
+
|
|
803
917
|
for (propName in defaultProps) {
|
|
804
918
|
if (props[propName] === undefined) {
|
|
805
919
|
props[propName] = defaultProps[propName];
|
|
806
920
|
}
|
|
807
921
|
}
|
|
808
922
|
}
|
|
923
|
+
|
|
809
924
|
{
|
|
810
925
|
if (key || ref) {
|
|
811
926
|
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
927
|
+
|
|
812
928
|
if (key) {
|
|
813
929
|
defineKeyPropWarningGetter(props, displayName);
|
|
814
930
|
}
|
|
931
|
+
|
|
815
932
|
if (ref) {
|
|
816
933
|
defineRefPropWarningGetter(props, displayName);
|
|
817
934
|
}
|
|
818
935
|
}
|
|
819
936
|
}
|
|
937
|
+
|
|
820
938
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
821
939
|
}
|
|
822
|
-
|
|
823
940
|
/**
|
|
824
941
|
* Return a function that produces ReactElements of a given type.
|
|
825
942
|
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
@@ -828,33 +945,34 @@ function createElement(type, config, children) {
|
|
|
828
945
|
|
|
829
946
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
830
947
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
831
|
-
|
|
832
948
|
return newElement;
|
|
833
949
|
}
|
|
834
|
-
|
|
835
950
|
/**
|
|
836
951
|
* Clone and return a new ReactElement using element as the starting point.
|
|
837
952
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
838
953
|
*/
|
|
954
|
+
|
|
839
955
|
function cloneElement(element, config, children) {
|
|
840
|
-
!!(element === null || element === undefined)
|
|
956
|
+
if (!!(element === null || element === undefined)) {
|
|
957
|
+
{
|
|
958
|
+
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
var propName; // Original props are copied
|
|
841
963
|
|
|
842
|
-
var
|
|
964
|
+
var props = _assign({}, element.props); // Reserved names are extracted
|
|
843
965
|
|
|
844
|
-
// Original props are copied
|
|
845
|
-
var props = _assign({}, element.props);
|
|
846
966
|
|
|
847
|
-
// Reserved names are extracted
|
|
848
967
|
var key = element.key;
|
|
849
|
-
var ref = element.ref;
|
|
850
|
-
|
|
851
|
-
var self = element._self;
|
|
852
|
-
// Source is preserved since cloneElement is unlikely to be targeted by a
|
|
968
|
+
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
969
|
+
|
|
970
|
+
var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
|
|
853
971
|
// transpiler, and the original source is probably a better indicator of the
|
|
854
972
|
// true owner.
|
|
855
|
-
var source = element._source;
|
|
856
973
|
|
|
857
|
-
// Owner will be preserved, unless ref is overridden
|
|
974
|
+
var source = element._source; // Owner will be preserved, unless ref is overridden
|
|
975
|
+
|
|
858
976
|
var owner = element._owner;
|
|
859
977
|
|
|
860
978
|
if (config != null) {
|
|
@@ -863,15 +981,18 @@ function cloneElement(element, config, children) {
|
|
|
863
981
|
ref = config.ref;
|
|
864
982
|
owner = ReactCurrentOwner.current;
|
|
865
983
|
}
|
|
984
|
+
|
|
866
985
|
if (hasValidKey(config)) {
|
|
867
986
|
key = '' + config.key;
|
|
868
|
-
}
|
|
987
|
+
} // Remaining properties override existing props
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
var defaultProps;
|
|
869
991
|
|
|
870
|
-
// Remaining properties override existing props
|
|
871
|
-
var defaultProps = void 0;
|
|
872
992
|
if (element.type && element.type.defaultProps) {
|
|
873
993
|
defaultProps = element.type.defaultProps;
|
|
874
994
|
}
|
|
995
|
+
|
|
875
996
|
for (propName in config) {
|
|
876
997
|
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
877
998
|
if (config[propName] === undefined && defaultProps !== undefined) {
|
|
@@ -882,24 +1003,26 @@ function cloneElement(element, config, children) {
|
|
|
882
1003
|
}
|
|
883
1004
|
}
|
|
884
1005
|
}
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
// Children can be more than one argument, and those are transferred onto
|
|
1006
|
+
} // Children can be more than one argument, and those are transferred onto
|
|
888
1007
|
// the newly allocated props object.
|
|
1008
|
+
|
|
1009
|
+
|
|
889
1010
|
var childrenLength = arguments.length - 2;
|
|
1011
|
+
|
|
890
1012
|
if (childrenLength === 1) {
|
|
891
1013
|
props.children = children;
|
|
892
1014
|
} else if (childrenLength > 1) {
|
|
893
1015
|
var childArray = Array(childrenLength);
|
|
1016
|
+
|
|
894
1017
|
for (var i = 0; i < childrenLength; i++) {
|
|
895
1018
|
childArray[i] = arguments[i + 2];
|
|
896
1019
|
}
|
|
1020
|
+
|
|
897
1021
|
props.children = childArray;
|
|
898
1022
|
}
|
|
899
1023
|
|
|
900
1024
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
901
1025
|
}
|
|
902
|
-
|
|
903
1026
|
/**
|
|
904
1027
|
* Verifies the object is a ReactElement.
|
|
905
1028
|
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
@@ -907,19 +1030,20 @@ function cloneElement(element, config, children) {
|
|
|
907
1030
|
* @return {boolean} True if `object` is a ReactElement.
|
|
908
1031
|
* @final
|
|
909
1032
|
*/
|
|
1033
|
+
|
|
910
1034
|
function isValidElement(object) {
|
|
911
1035
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
912
1036
|
}
|
|
913
1037
|
|
|
914
1038
|
var SEPARATOR = '.';
|
|
915
1039
|
var SUBSEPARATOR = ':';
|
|
916
|
-
|
|
917
1040
|
/**
|
|
918
1041
|
* Escape and wrap key so it is safe to use as a reactid
|
|
919
1042
|
*
|
|
920
1043
|
* @param {string} key to be escaped.
|
|
921
1044
|
* @return {string} the escaped key.
|
|
922
1045
|
*/
|
|
1046
|
+
|
|
923
1047
|
function escape(key) {
|
|
924
1048
|
var escapeRegex = /[=:]/g;
|
|
925
1049
|
var escaperLookup = {
|
|
@@ -929,24 +1053,24 @@ function escape(key) {
|
|
|
929
1053
|
var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
|
930
1054
|
return escaperLookup[match];
|
|
931
1055
|
});
|
|
932
|
-
|
|
933
1056
|
return '$' + escapedString;
|
|
934
1057
|
}
|
|
935
|
-
|
|
936
1058
|
/**
|
|
937
1059
|
* TODO: Test that a single child and an array with one item have the same key
|
|
938
1060
|
* pattern.
|
|
939
1061
|
*/
|
|
940
1062
|
|
|
941
|
-
var didWarnAboutMaps = false;
|
|
942
1063
|
|
|
1064
|
+
var didWarnAboutMaps = false;
|
|
943
1065
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
1066
|
+
|
|
944
1067
|
function escapeUserProvidedKey(text) {
|
|
945
1068
|
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
|
946
1069
|
}
|
|
947
1070
|
|
|
948
1071
|
var POOL_SIZE = 10;
|
|
949
1072
|
var traverseContextPool = [];
|
|
1073
|
+
|
|
950
1074
|
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
|
951
1075
|
if (traverseContextPool.length) {
|
|
952
1076
|
var traverseContext = traverseContextPool.pop();
|
|
@@ -973,11 +1097,11 @@ function releaseTraverseContext(traverseContext) {
|
|
|
973
1097
|
traverseContext.func = null;
|
|
974
1098
|
traverseContext.context = null;
|
|
975
1099
|
traverseContext.count = 0;
|
|
1100
|
+
|
|
976
1101
|
if (traverseContextPool.length < POOL_SIZE) {
|
|
977
1102
|
traverseContextPool.push(traverseContext);
|
|
978
1103
|
}
|
|
979
1104
|
}
|
|
980
|
-
|
|
981
1105
|
/**
|
|
982
1106
|
* @param {?*} children Children tree container.
|
|
983
1107
|
* @param {!string} nameSoFar Name of the key path so far.
|
|
@@ -986,6 +1110,8 @@ function releaseTraverseContext(traverseContext) {
|
|
|
986
1110
|
* process.
|
|
987
1111
|
* @return {!number} The number of children in this subtree.
|
|
988
1112
|
*/
|
|
1113
|
+
|
|
1114
|
+
|
|
989
1115
|
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
|
990
1116
|
var type = typeof children;
|
|
991
1117
|
|
|
@@ -1004,26 +1130,28 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1004
1130
|
case 'number':
|
|
1005
1131
|
invokeCallback = true;
|
|
1006
1132
|
break;
|
|
1133
|
+
|
|
1007
1134
|
case 'object':
|
|
1008
1135
|
switch (children.$$typeof) {
|
|
1009
1136
|
case REACT_ELEMENT_TYPE:
|
|
1010
1137
|
case REACT_PORTAL_TYPE:
|
|
1011
1138
|
invokeCallback = true;
|
|
1012
1139
|
}
|
|
1140
|
+
|
|
1013
1141
|
}
|
|
1014
1142
|
}
|
|
1015
1143
|
|
|
1016
1144
|
if (invokeCallback) {
|
|
1017
|
-
callback(traverseContext, children,
|
|
1018
|
-
// If it's the only child, treat the name as if it was wrapped in an array
|
|
1145
|
+
callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
|
|
1019
1146
|
// so that it's consistent if the number of children grows.
|
|
1020
1147
|
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
|
1021
1148
|
return 1;
|
|
1022
1149
|
}
|
|
1023
1150
|
|
|
1024
|
-
var child
|
|
1025
|
-
var nextName
|
|
1151
|
+
var child;
|
|
1152
|
+
var nextName;
|
|
1026
1153
|
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1154
|
+
|
|
1027
1155
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1028
1156
|
|
|
1029
1157
|
if (Array.isArray(children)) {
|
|
@@ -1034,6 +1162,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1034
1162
|
}
|
|
1035
1163
|
} else {
|
|
1036
1164
|
var iteratorFn = getIteratorFn(children);
|
|
1165
|
+
|
|
1037
1166
|
if (typeof iteratorFn === 'function') {
|
|
1038
1167
|
{
|
|
1039
1168
|
// Warn about using Maps as children
|
|
@@ -1044,8 +1173,9 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1044
1173
|
}
|
|
1045
1174
|
|
|
1046
1175
|
var iterator = iteratorFn.call(children);
|
|
1047
|
-
var step
|
|
1176
|
+
var step;
|
|
1048
1177
|
var ii = 0;
|
|
1178
|
+
|
|
1049
1179
|
while (!(step = iterator.next()).done) {
|
|
1050
1180
|
child = step.value;
|
|
1051
1181
|
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
|
@@ -1053,17 +1183,23 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1053
1183
|
}
|
|
1054
1184
|
} else if (type === 'object') {
|
|
1055
1185
|
var addendum = '';
|
|
1186
|
+
|
|
1056
1187
|
{
|
|
1057
1188
|
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1058
1189
|
}
|
|
1190
|
+
|
|
1059
1191
|
var childrenString = '' + children;
|
|
1060
|
-
|
|
1192
|
+
|
|
1193
|
+
{
|
|
1194
|
+
{
|
|
1195
|
+
throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1061
1198
|
}
|
|
1062
1199
|
}
|
|
1063
1200
|
|
|
1064
1201
|
return subtreeCount;
|
|
1065
1202
|
}
|
|
1066
|
-
|
|
1067
1203
|
/**
|
|
1068
1204
|
* Traverses children that are typically specified as `props.children`, but
|
|
1069
1205
|
* might also be specified through attributes:
|
|
@@ -1080,6 +1216,8 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1080
1216
|
* @param {?*} traverseContext Context for traversal.
|
|
1081
1217
|
* @return {!number} The number of children in this subtree.
|
|
1082
1218
|
*/
|
|
1219
|
+
|
|
1220
|
+
|
|
1083
1221
|
function traverseAllChildren(children, callback, traverseContext) {
|
|
1084
1222
|
if (children == null) {
|
|
1085
1223
|
return 0;
|
|
@@ -1087,7 +1225,6 @@ function traverseAllChildren(children, callback, traverseContext) {
|
|
|
1087
1225
|
|
|
1088
1226
|
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
1089
1227
|
}
|
|
1090
|
-
|
|
1091
1228
|
/**
|
|
1092
1229
|
* Generate a key string that identifies a component within a set.
|
|
1093
1230
|
*
|
|
@@ -1095,24 +1232,25 @@ function traverseAllChildren(children, callback, traverseContext) {
|
|
|
1095
1232
|
* @param {number} index Index that is used if a manual key is not provided.
|
|
1096
1233
|
* @return {string}
|
|
1097
1234
|
*/
|
|
1235
|
+
|
|
1236
|
+
|
|
1098
1237
|
function getComponentKey(component, index) {
|
|
1099
1238
|
// Do some typechecking here since we call this blindly. We want to ensure
|
|
1100
1239
|
// that we don't block potential future ES APIs.
|
|
1101
1240
|
if (typeof component === 'object' && component !== null && component.key != null) {
|
|
1102
1241
|
// Explicit key
|
|
1103
1242
|
return escape(component.key);
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1243
|
+
} // Implicit key determined by the index in the set
|
|
1244
|
+
|
|
1245
|
+
|
|
1106
1246
|
return index.toString(36);
|
|
1107
1247
|
}
|
|
1108
1248
|
|
|
1109
1249
|
function forEachSingleChild(bookKeeping, child, name) {
|
|
1110
1250
|
var func = bookKeeping.func,
|
|
1111
1251
|
context = bookKeeping.context;
|
|
1112
|
-
|
|
1113
1252
|
func.call(context, child, bookKeeping.count++);
|
|
1114
1253
|
}
|
|
1115
|
-
|
|
1116
1254
|
/**
|
|
1117
1255
|
* Iterates through children that are typically specified as `props.children`.
|
|
1118
1256
|
*
|
|
@@ -1125,10 +1263,13 @@ function forEachSingleChild(bookKeeping, child, name) {
|
|
|
1125
1263
|
* @param {function(*, int)} forEachFunc
|
|
1126
1264
|
* @param {*} forEachContext Context for forEachContext.
|
|
1127
1265
|
*/
|
|
1266
|
+
|
|
1267
|
+
|
|
1128
1268
|
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1129
1269
|
if (children == null) {
|
|
1130
1270
|
return children;
|
|
1131
1271
|
}
|
|
1272
|
+
|
|
1132
1273
|
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
|
1133
1274
|
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
1134
1275
|
releaseTraverseContext(traverseContext);
|
|
@@ -1139,34 +1280,34 @@ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
|
1139
1280
|
keyPrefix = bookKeeping.keyPrefix,
|
|
1140
1281
|
func = bookKeeping.func,
|
|
1141
1282
|
context = bookKeeping.context;
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
1283
|
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
1284
|
+
|
|
1145
1285
|
if (Array.isArray(mappedChild)) {
|
|
1146
1286
|
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
|
1147
1287
|
return c;
|
|
1148
1288
|
});
|
|
1149
1289
|
} else if (mappedChild != null) {
|
|
1150
1290
|
if (isValidElement(mappedChild)) {
|
|
1151
|
-
mappedChild = cloneAndReplaceKey(mappedChild,
|
|
1152
|
-
// Keep both the (mapped) and old keys if they differ, just as
|
|
1291
|
+
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1153
1292
|
// traverseAllChildren used to do for objects as children
|
|
1154
1293
|
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
1155
1294
|
}
|
|
1295
|
+
|
|
1156
1296
|
result.push(mappedChild);
|
|
1157
1297
|
}
|
|
1158
1298
|
}
|
|
1159
1299
|
|
|
1160
1300
|
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
1161
1301
|
var escapedPrefix = '';
|
|
1302
|
+
|
|
1162
1303
|
if (prefix != null) {
|
|
1163
1304
|
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
1164
1305
|
}
|
|
1306
|
+
|
|
1165
1307
|
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
|
1166
1308
|
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
1167
1309
|
releaseTraverseContext(traverseContext);
|
|
1168
1310
|
}
|
|
1169
|
-
|
|
1170
1311
|
/**
|
|
1171
1312
|
* Maps children that are typically specified as `props.children`.
|
|
1172
1313
|
*
|
|
@@ -1180,15 +1321,17 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
|
1180
1321
|
* @param {*} context Context for mapFunction.
|
|
1181
1322
|
* @return {object} Object containing the ordered map of results.
|
|
1182
1323
|
*/
|
|
1324
|
+
|
|
1325
|
+
|
|
1183
1326
|
function mapChildren(children, func, context) {
|
|
1184
1327
|
if (children == null) {
|
|
1185
1328
|
return children;
|
|
1186
1329
|
}
|
|
1330
|
+
|
|
1187
1331
|
var result = [];
|
|
1188
1332
|
mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
|
1189
1333
|
return result;
|
|
1190
1334
|
}
|
|
1191
|
-
|
|
1192
1335
|
/**
|
|
1193
1336
|
* Count the number of children that are typically specified as
|
|
1194
1337
|
* `props.children`.
|
|
@@ -1198,18 +1341,21 @@ function mapChildren(children, func, context) {
|
|
|
1198
1341
|
* @param {?*} children Children tree container.
|
|
1199
1342
|
* @return {number} The number of children.
|
|
1200
1343
|
*/
|
|
1344
|
+
|
|
1345
|
+
|
|
1201
1346
|
function countChildren(children) {
|
|
1202
1347
|
return traverseAllChildren(children, function () {
|
|
1203
1348
|
return null;
|
|
1204
1349
|
}, null);
|
|
1205
1350
|
}
|
|
1206
|
-
|
|
1207
1351
|
/**
|
|
1208
1352
|
* Flatten a children object (typically specified as `props.children`) and
|
|
1209
1353
|
* return an array with appropriately re-keyed children.
|
|
1210
1354
|
*
|
|
1211
1355
|
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
|
1212
1356
|
*/
|
|
1357
|
+
|
|
1358
|
+
|
|
1213
1359
|
function toArray(children) {
|
|
1214
1360
|
var result = [];
|
|
1215
1361
|
mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
|
@@ -1217,7 +1363,6 @@ function toArray(children) {
|
|
|
1217
1363
|
});
|
|
1218
1364
|
return result;
|
|
1219
1365
|
}
|
|
1220
|
-
|
|
1221
1366
|
/**
|
|
1222
1367
|
* Returns the first child in a collection of children and verifies that there
|
|
1223
1368
|
* is only one child in the collection.
|
|
@@ -1232,8 +1377,15 @@ function toArray(children) {
|
|
|
1232
1377
|
* @return {ReactElement} The first and only `ReactElement` contained in the
|
|
1233
1378
|
* structure.
|
|
1234
1379
|
*/
|
|
1380
|
+
|
|
1381
|
+
|
|
1235
1382
|
function onlyChild(children) {
|
|
1236
|
-
!isValidElement(children)
|
|
1383
|
+
if (!isValidElement(children)) {
|
|
1384
|
+
{
|
|
1385
|
+
throw Error("React.Children.only expected to receive a single React element child.");
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1237
1389
|
return children;
|
|
1238
1390
|
}
|
|
1239
1391
|
|
|
@@ -1263,12 +1415,10 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1263
1415
|
Provider: null,
|
|
1264
1416
|
Consumer: null
|
|
1265
1417
|
};
|
|
1266
|
-
|
|
1267
1418
|
context.Provider = {
|
|
1268
1419
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
1269
1420
|
_context: context
|
|
1270
1421
|
};
|
|
1271
|
-
|
|
1272
1422
|
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1273
1423
|
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1274
1424
|
|
|
@@ -1280,8 +1430,8 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1280
1430
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1281
1431
|
_context: context,
|
|
1282
1432
|
_calculateChangedBits: context._calculateChangedBits
|
|
1283
|
-
};
|
|
1284
|
-
|
|
1433
|
+
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1434
|
+
|
|
1285
1435
|
Object.defineProperties(Consumer, {
|
|
1286
1436
|
Provider: {
|
|
1287
1437
|
get: function () {
|
|
@@ -1289,6 +1439,7 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1289
1439
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
1290
1440
|
warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
1291
1441
|
}
|
|
1442
|
+
|
|
1292
1443
|
return context.Provider;
|
|
1293
1444
|
},
|
|
1294
1445
|
set: function (_Provider) {
|
|
@@ -1325,11 +1476,12 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1325
1476
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1326
1477
|
warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
1327
1478
|
}
|
|
1479
|
+
|
|
1328
1480
|
return context.Consumer;
|
|
1329
1481
|
}
|
|
1330
1482
|
}
|
|
1331
|
-
});
|
|
1332
|
-
|
|
1483
|
+
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1484
|
+
|
|
1333
1485
|
context.Consumer = Consumer;
|
|
1334
1486
|
}
|
|
1335
1487
|
|
|
@@ -1352,8 +1504,8 @@ function lazy(ctor) {
|
|
|
1352
1504
|
|
|
1353
1505
|
{
|
|
1354
1506
|
// In production, this would just set it on the object.
|
|
1355
|
-
var defaultProps
|
|
1356
|
-
var propTypes
|
|
1507
|
+
var defaultProps;
|
|
1508
|
+
var propTypes;
|
|
1357
1509
|
Object.defineProperties(lazyType, {
|
|
1358
1510
|
defaultProps: {
|
|
1359
1511
|
configurable: true,
|
|
@@ -1362,8 +1514,8 @@ function lazy(ctor) {
|
|
|
1362
1514
|
},
|
|
1363
1515
|
set: function (newDefaultProps) {
|
|
1364
1516
|
warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1365
|
-
defaultProps = newDefaultProps;
|
|
1366
|
-
|
|
1517
|
+
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1518
|
+
|
|
1367
1519
|
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1368
1520
|
enumerable: true
|
|
1369
1521
|
});
|
|
@@ -1376,8 +1528,8 @@ function lazy(ctor) {
|
|
|
1376
1528
|
},
|
|
1377
1529
|
set: function (newPropTypes) {
|
|
1378
1530
|
warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1379
|
-
propTypes = newPropTypes;
|
|
1380
|
-
|
|
1531
|
+
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1532
|
+
|
|
1381
1533
|
Object.defineProperty(lazyType, 'propTypes', {
|
|
1382
1534
|
enumerable: true
|
|
1383
1535
|
});
|
|
@@ -1396,8 +1548,7 @@ function forwardRef(render) {
|
|
|
1396
1548
|
} else if (typeof render !== 'function') {
|
|
1397
1549
|
warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1398
1550
|
} else {
|
|
1399
|
-
!(
|
|
1400
|
-
// Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
|
|
1551
|
+
!( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
|
|
1401
1552
|
render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
|
|
1402
1553
|
}
|
|
1403
1554
|
|
|
@@ -1413,9 +1564,8 @@ function forwardRef(render) {
|
|
|
1413
1564
|
}
|
|
1414
1565
|
|
|
1415
1566
|
function isValidElementType(type) {
|
|
1416
|
-
return typeof type === 'string' || typeof type === 'function' ||
|
|
1417
|
-
|
|
1418
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
1567
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1568
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
1419
1569
|
}
|
|
1420
1570
|
|
|
1421
1571
|
function memo(type, compare) {
|
|
@@ -1424,6 +1574,7 @@ function memo(type, compare) {
|
|
|
1424
1574
|
warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1425
1575
|
}
|
|
1426
1576
|
}
|
|
1577
|
+
|
|
1427
1578
|
return {
|
|
1428
1579
|
$$typeof: REACT_MEMO_TYPE,
|
|
1429
1580
|
type: type,
|
|
@@ -1433,20 +1584,26 @@ function memo(type, compare) {
|
|
|
1433
1584
|
|
|
1434
1585
|
function resolveDispatcher() {
|
|
1435
1586
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1436
|
-
|
|
1587
|
+
|
|
1588
|
+
if (!(dispatcher !== null)) {
|
|
1589
|
+
{
|
|
1590
|
+
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.");
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1437
1594
|
return dispatcher;
|
|
1438
1595
|
}
|
|
1439
1596
|
|
|
1440
1597
|
function useContext(Context, unstable_observedBits) {
|
|
1441
1598
|
var dispatcher = resolveDispatcher();
|
|
1599
|
+
|
|
1442
1600
|
{
|
|
1443
|
-
!(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;
|
|
1601
|
+
!(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values.
|
|
1444
1602
|
|
|
1445
|
-
// TODO: add a more generic warning for invalid values.
|
|
1446
1603
|
if (Context._context !== undefined) {
|
|
1447
|
-
var realContext = Context._context;
|
|
1448
|
-
// Don't deduplicate because this legitimately causes bugs
|
|
1604
|
+
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1449
1605
|
// and nobody should be using this in existing code.
|
|
1606
|
+
|
|
1450
1607
|
if (realContext.Consumer === Context) {
|
|
1451
1608
|
warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
1452
1609
|
} else if (realContext.Provider === Context) {
|
|
@@ -1454,55 +1611,79 @@ function useContext(Context, unstable_observedBits) {
|
|
|
1454
1611
|
}
|
|
1455
1612
|
}
|
|
1456
1613
|
}
|
|
1614
|
+
|
|
1457
1615
|
return dispatcher.useContext(Context, unstable_observedBits);
|
|
1458
1616
|
}
|
|
1459
|
-
|
|
1460
1617
|
function useState(initialState) {
|
|
1461
1618
|
var dispatcher = resolveDispatcher();
|
|
1462
1619
|
return dispatcher.useState(initialState);
|
|
1463
1620
|
}
|
|
1464
|
-
|
|
1465
1621
|
function useReducer(reducer, initialArg, init) {
|
|
1466
1622
|
var dispatcher = resolveDispatcher();
|
|
1467
1623
|
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1468
1624
|
}
|
|
1469
|
-
|
|
1470
1625
|
function useRef(initialValue) {
|
|
1471
1626
|
var dispatcher = resolveDispatcher();
|
|
1472
1627
|
return dispatcher.useRef(initialValue);
|
|
1473
1628
|
}
|
|
1474
|
-
|
|
1475
1629
|
function useEffect(create, inputs) {
|
|
1476
1630
|
var dispatcher = resolveDispatcher();
|
|
1477
1631
|
return dispatcher.useEffect(create, inputs);
|
|
1478
1632
|
}
|
|
1479
|
-
|
|
1480
1633
|
function useLayoutEffect(create, inputs) {
|
|
1481
1634
|
var dispatcher = resolveDispatcher();
|
|
1482
1635
|
return dispatcher.useLayoutEffect(create, inputs);
|
|
1483
1636
|
}
|
|
1484
|
-
|
|
1485
1637
|
function useCallback(callback, inputs) {
|
|
1486
1638
|
var dispatcher = resolveDispatcher();
|
|
1487
1639
|
return dispatcher.useCallback(callback, inputs);
|
|
1488
1640
|
}
|
|
1489
|
-
|
|
1490
1641
|
function useMemo(create, inputs) {
|
|
1491
1642
|
var dispatcher = resolveDispatcher();
|
|
1492
1643
|
return dispatcher.useMemo(create, inputs);
|
|
1493
1644
|
}
|
|
1494
|
-
|
|
1495
1645
|
function useImperativeHandle(ref, create, inputs) {
|
|
1496
1646
|
var dispatcher = resolveDispatcher();
|
|
1497
1647
|
return dispatcher.useImperativeHandle(ref, create, inputs);
|
|
1498
1648
|
}
|
|
1499
|
-
|
|
1500
1649
|
function useDebugValue(value, formatterFn) {
|
|
1501
1650
|
{
|
|
1502
1651
|
var dispatcher = resolveDispatcher();
|
|
1503
1652
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1504
1653
|
}
|
|
1505
1654
|
}
|
|
1655
|
+
var emptyObject$1 = {};
|
|
1656
|
+
function useResponder(responder, listenerProps) {
|
|
1657
|
+
var dispatcher = resolveDispatcher();
|
|
1658
|
+
|
|
1659
|
+
{
|
|
1660
|
+
if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
|
|
1661
|
+
warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
|
|
1667
|
+
}
|
|
1668
|
+
function useTransition(config) {
|
|
1669
|
+
var dispatcher = resolveDispatcher();
|
|
1670
|
+
return dispatcher.useTransition(config);
|
|
1671
|
+
}
|
|
1672
|
+
function useDeferredValue(value, config) {
|
|
1673
|
+
var dispatcher = resolveDispatcher();
|
|
1674
|
+
return dispatcher.useDeferredValue(value, config);
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
function withSuspenseConfig(scope, config) {
|
|
1678
|
+
var previousConfig = ReactCurrentBatchConfig.suspense;
|
|
1679
|
+
ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
|
|
1680
|
+
|
|
1681
|
+
try {
|
|
1682
|
+
scope();
|
|
1683
|
+
} finally {
|
|
1684
|
+
ReactCurrentBatchConfig.suspense = previousConfig;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1506
1687
|
|
|
1507
1688
|
/**
|
|
1508
1689
|
* ReactElementValidator provides a wrapper around a element factory
|
|
@@ -1510,38 +1691,50 @@ function useDebugValue(value, formatterFn) {
|
|
|
1510
1691
|
* used only in DEV and could be replaced by a static type checker for languages
|
|
1511
1692
|
* that support it.
|
|
1512
1693
|
*/
|
|
1513
|
-
|
|
1514
|
-
var propTypesMisspellWarningShown = void 0;
|
|
1694
|
+
var propTypesMisspellWarningShown;
|
|
1515
1695
|
|
|
1516
1696
|
{
|
|
1517
1697
|
propTypesMisspellWarningShown = false;
|
|
1518
1698
|
}
|
|
1519
1699
|
|
|
1700
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1701
|
+
|
|
1520
1702
|
function getDeclarationErrorAddendum() {
|
|
1521
1703
|
if (ReactCurrentOwner.current) {
|
|
1522
1704
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
1705
|
+
|
|
1523
1706
|
if (name) {
|
|
1524
1707
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
1525
1708
|
}
|
|
1526
1709
|
}
|
|
1710
|
+
|
|
1527
1711
|
return '';
|
|
1528
1712
|
}
|
|
1529
1713
|
|
|
1530
|
-
function getSourceInfoErrorAddendum(
|
|
1531
|
-
if (
|
|
1532
|
-
var source = elementProps.__source;
|
|
1714
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1715
|
+
if (source !== undefined) {
|
|
1533
1716
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1534
1717
|
var lineNumber = source.lineNumber;
|
|
1535
1718
|
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1536
1719
|
}
|
|
1720
|
+
|
|
1537
1721
|
return '';
|
|
1538
1722
|
}
|
|
1539
1723
|
|
|
1724
|
+
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1725
|
+
if (elementProps !== null && elementProps !== undefined) {
|
|
1726
|
+
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
return '';
|
|
1730
|
+
}
|
|
1540
1731
|
/**
|
|
1541
1732
|
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1542
1733
|
* object keys are not valid. This allows us to keep track of children between
|
|
1543
1734
|
* updates.
|
|
1544
1735
|
*/
|
|
1736
|
+
|
|
1737
|
+
|
|
1545
1738
|
var ownerHasKeyUseWarning = {};
|
|
1546
1739
|
|
|
1547
1740
|
function getCurrentComponentErrorInfo(parentType) {
|
|
@@ -1549,13 +1742,14 @@ function getCurrentComponentErrorInfo(parentType) {
|
|
|
1549
1742
|
|
|
1550
1743
|
if (!info) {
|
|
1551
1744
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1745
|
+
|
|
1552
1746
|
if (parentName) {
|
|
1553
|
-
info =
|
|
1747
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1554
1748
|
}
|
|
1555
1749
|
}
|
|
1750
|
+
|
|
1556
1751
|
return info;
|
|
1557
1752
|
}
|
|
1558
|
-
|
|
1559
1753
|
/**
|
|
1560
1754
|
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1561
1755
|
* This element is in an array. The array could grow and shrink or be
|
|
@@ -1567,34 +1761,39 @@ function getCurrentComponentErrorInfo(parentType) {
|
|
|
1567
1761
|
* @param {ReactElement} element Element that requires a key.
|
|
1568
1762
|
* @param {*} parentType element's parent's type.
|
|
1569
1763
|
*/
|
|
1764
|
+
|
|
1765
|
+
|
|
1570
1766
|
function validateExplicitKey(element, parentType) {
|
|
1571
1767
|
if (!element._store || element._store.validated || element.key != null) {
|
|
1572
1768
|
return;
|
|
1573
1769
|
}
|
|
1574
|
-
element._store.validated = true;
|
|
1575
1770
|
|
|
1771
|
+
element._store.validated = true;
|
|
1576
1772
|
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1773
|
+
|
|
1577
1774
|
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1578
1775
|
return;
|
|
1579
1776
|
}
|
|
1580
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1581
1777
|
|
|
1582
|
-
// Usually the current owner is the offender, but if it accepts children as a
|
|
1778
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1583
1779
|
// property, it may be the creator of the child that's responsible for
|
|
1584
1780
|
// assigning it a key.
|
|
1781
|
+
|
|
1585
1782
|
var childOwner = '';
|
|
1783
|
+
|
|
1586
1784
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1587
1785
|
// Give the component that originally created this child.
|
|
1588
|
-
childOwner =
|
|
1786
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1589
1787
|
}
|
|
1590
1788
|
|
|
1591
1789
|
setCurrentlyValidatingElement(element);
|
|
1790
|
+
|
|
1592
1791
|
{
|
|
1593
1792
|
warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1594
1793
|
}
|
|
1794
|
+
|
|
1595
1795
|
setCurrentlyValidatingElement(null);
|
|
1596
1796
|
}
|
|
1597
|
-
|
|
1598
1797
|
/**
|
|
1599
1798
|
* Ensure that every element either is passed in a static location, in an
|
|
1600
1799
|
* array with an explicit keys property defined, or in an object literal
|
|
@@ -1604,13 +1803,17 @@ function validateExplicitKey(element, parentType) {
|
|
|
1604
1803
|
* @param {ReactNode} node Statically passed child of any type.
|
|
1605
1804
|
* @param {*} parentType node's parent's type.
|
|
1606
1805
|
*/
|
|
1806
|
+
|
|
1807
|
+
|
|
1607
1808
|
function validateChildKeys(node, parentType) {
|
|
1608
1809
|
if (typeof node !== 'object') {
|
|
1609
1810
|
return;
|
|
1610
1811
|
}
|
|
1812
|
+
|
|
1611
1813
|
if (Array.isArray(node)) {
|
|
1612
1814
|
for (var i = 0; i < node.length; i++) {
|
|
1613
1815
|
var child = node[i];
|
|
1816
|
+
|
|
1614
1817
|
if (isValidElement(child)) {
|
|
1615
1818
|
validateExplicitKey(child, parentType);
|
|
1616
1819
|
}
|
|
@@ -1622,12 +1825,14 @@ function validateChildKeys(node, parentType) {
|
|
|
1622
1825
|
}
|
|
1623
1826
|
} else if (node) {
|
|
1624
1827
|
var iteratorFn = getIteratorFn(node);
|
|
1828
|
+
|
|
1625
1829
|
if (typeof iteratorFn === 'function') {
|
|
1626
1830
|
// Entry iterators used to provide implicit keys,
|
|
1627
1831
|
// but now we print a separate warning for them later.
|
|
1628
1832
|
if (iteratorFn !== node.entries) {
|
|
1629
1833
|
var iterator = iteratorFn.call(node);
|
|
1630
|
-
var step
|
|
1834
|
+
var step;
|
|
1835
|
+
|
|
1631
1836
|
while (!(step = iterator.next()).done) {
|
|
1632
1837
|
if (isValidElement(step.value)) {
|
|
1633
1838
|
validateExplicitKey(step.value, parentType);
|
|
@@ -1637,30 +1842,34 @@ function validateChildKeys(node, parentType) {
|
|
|
1637
1842
|
}
|
|
1638
1843
|
}
|
|
1639
1844
|
}
|
|
1640
|
-
|
|
1641
1845
|
/**
|
|
1642
1846
|
* Given an element, validate that its props follow the propTypes definition,
|
|
1643
1847
|
* provided by the type.
|
|
1644
1848
|
*
|
|
1645
1849
|
* @param {ReactElement} element
|
|
1646
1850
|
*/
|
|
1851
|
+
|
|
1852
|
+
|
|
1647
1853
|
function validatePropTypes(element) {
|
|
1648
1854
|
var type = element.type;
|
|
1855
|
+
|
|
1649
1856
|
if (type === null || type === undefined || typeof type === 'string') {
|
|
1650
1857
|
return;
|
|
1651
1858
|
}
|
|
1859
|
+
|
|
1652
1860
|
var name = getComponentName(type);
|
|
1653
|
-
var propTypes
|
|
1861
|
+
var propTypes;
|
|
1862
|
+
|
|
1654
1863
|
if (typeof type === 'function') {
|
|
1655
1864
|
propTypes = type.propTypes;
|
|
1656
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
1657
|
-
// Note: Memo only checks outer props here.
|
|
1865
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1658
1866
|
// Inner props are checked in the reconciler.
|
|
1659
1867
|
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1660
1868
|
propTypes = type.propTypes;
|
|
1661
1869
|
} else {
|
|
1662
1870
|
return;
|
|
1663
1871
|
}
|
|
1872
|
+
|
|
1664
1873
|
if (propTypes) {
|
|
1665
1874
|
setCurrentlyValidatingElement(element);
|
|
1666
1875
|
checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
|
@@ -1669,21 +1878,24 @@ function validatePropTypes(element) {
|
|
|
1669
1878
|
propTypesMisspellWarningShown = true;
|
|
1670
1879
|
warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
1671
1880
|
}
|
|
1881
|
+
|
|
1672
1882
|
if (typeof type.getDefaultProps === 'function') {
|
|
1673
1883
|
!type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
|
1674
1884
|
}
|
|
1675
1885
|
}
|
|
1676
|
-
|
|
1677
1886
|
/**
|
|
1678
1887
|
* Given a fragment, validate that it can only be provided with fragment props
|
|
1679
1888
|
* @param {ReactElement} fragment
|
|
1680
1889
|
*/
|
|
1890
|
+
|
|
1891
|
+
|
|
1681
1892
|
function validateFragmentProps(fragment) {
|
|
1682
1893
|
setCurrentlyValidatingElement(fragment);
|
|
1683
|
-
|
|
1684
1894
|
var keys = Object.keys(fragment.props);
|
|
1895
|
+
|
|
1685
1896
|
for (var i = 0; i < keys.length; i++) {
|
|
1686
1897
|
var key = keys[i];
|
|
1898
|
+
|
|
1687
1899
|
if (key !== 'children' && key !== 'key') {
|
|
1688
1900
|
warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1689
1901
|
break;
|
|
@@ -1697,52 +1909,144 @@ function validateFragmentProps(fragment) {
|
|
|
1697
1909
|
setCurrentlyValidatingElement(null);
|
|
1698
1910
|
}
|
|
1699
1911
|
|
|
1700
|
-
function
|
|
1701
|
-
var validType = isValidElementType(type);
|
|
1702
|
-
|
|
1703
|
-
// We warn in this case but don't throw. We expect the element creation to
|
|
1912
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1913
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1704
1914
|
// succeed and there will likely be errors in render.
|
|
1915
|
+
|
|
1705
1916
|
if (!validType) {
|
|
1706
1917
|
var info = '';
|
|
1918
|
+
|
|
1707
1919
|
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1708
1920
|
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1709
1921
|
}
|
|
1710
1922
|
|
|
1711
|
-
var sourceInfo = getSourceInfoErrorAddendum(
|
|
1923
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1924
|
+
|
|
1712
1925
|
if (sourceInfo) {
|
|
1713
1926
|
info += sourceInfo;
|
|
1714
1927
|
} else {
|
|
1715
1928
|
info += getDeclarationErrorAddendum();
|
|
1716
1929
|
}
|
|
1717
1930
|
|
|
1718
|
-
var typeString
|
|
1931
|
+
var typeString;
|
|
1932
|
+
|
|
1719
1933
|
if (type === null) {
|
|
1720
1934
|
typeString = 'null';
|
|
1721
1935
|
} else if (Array.isArray(type)) {
|
|
1722
1936
|
typeString = 'array';
|
|
1723
1937
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1724
|
-
typeString =
|
|
1938
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
1725
1939
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1726
1940
|
} else {
|
|
1727
1941
|
typeString = typeof type;
|
|
1728
1942
|
}
|
|
1729
1943
|
|
|
1730
|
-
warning$1(false, 'React.
|
|
1944
|
+
warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1731
1945
|
}
|
|
1732
1946
|
|
|
1733
|
-
var element =
|
|
1734
|
-
|
|
1735
|
-
// The result can be nullish if a mock or a custom function is used.
|
|
1947
|
+
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1736
1948
|
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1949
|
+
|
|
1737
1950
|
if (element == null) {
|
|
1738
1951
|
return element;
|
|
1952
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1953
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1954
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1955
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1956
|
+
// fixed, the key warnings will appear.)
|
|
1957
|
+
|
|
1958
|
+
|
|
1959
|
+
if (validType) {
|
|
1960
|
+
var children = props.children;
|
|
1961
|
+
|
|
1962
|
+
if (children !== undefined) {
|
|
1963
|
+
if (isStaticChildren) {
|
|
1964
|
+
if (Array.isArray(children)) {
|
|
1965
|
+
for (var i = 0; i < children.length; i++) {
|
|
1966
|
+
validateChildKeys(children[i], type);
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
if (Object.freeze) {
|
|
1970
|
+
Object.freeze(children);
|
|
1971
|
+
}
|
|
1972
|
+
} else {
|
|
1973
|
+
warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1974
|
+
}
|
|
1975
|
+
} else {
|
|
1976
|
+
validateChildKeys(children, type);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
if (hasOwnProperty$1.call(props, 'key')) {
|
|
1982
|
+
warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1986
|
+
validateFragmentProps(element);
|
|
1987
|
+
} else {
|
|
1988
|
+
validatePropTypes(element);
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
return element;
|
|
1992
|
+
} // These two functions exist to still get child warnings in dev
|
|
1993
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
1994
|
+
// opt-in behavior for better messages but that we won't stop
|
|
1995
|
+
// giving you warnings if you use production apis.
|
|
1996
|
+
|
|
1997
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
1998
|
+
return jsxWithValidation(type, props, key, true);
|
|
1999
|
+
}
|
|
2000
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
2001
|
+
return jsxWithValidation(type, props, key, false);
|
|
2002
|
+
}
|
|
2003
|
+
function createElementWithValidation(type, props, children) {
|
|
2004
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2005
|
+
// succeed and there will likely be errors in render.
|
|
2006
|
+
|
|
2007
|
+
if (!validType) {
|
|
2008
|
+
var info = '';
|
|
2009
|
+
|
|
2010
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2011
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
2015
|
+
|
|
2016
|
+
if (sourceInfo) {
|
|
2017
|
+
info += sourceInfo;
|
|
2018
|
+
} else {
|
|
2019
|
+
info += getDeclarationErrorAddendum();
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
var typeString;
|
|
2023
|
+
|
|
2024
|
+
if (type === null) {
|
|
2025
|
+
typeString = 'null';
|
|
2026
|
+
} else if (Array.isArray(type)) {
|
|
2027
|
+
typeString = 'array';
|
|
2028
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2029
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2030
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2031
|
+
} else {
|
|
2032
|
+
typeString = typeof type;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1739
2036
|
}
|
|
1740
2037
|
|
|
1741
|
-
//
|
|
2038
|
+
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
2039
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2040
|
+
|
|
2041
|
+
if (element == null) {
|
|
2042
|
+
return element;
|
|
2043
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1742
2044
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1743
2045
|
// We don't want exception behavior to differ between dev and prod.
|
|
1744
2046
|
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1745
2047
|
// fixed, the key warnings will appear.)
|
|
2048
|
+
|
|
2049
|
+
|
|
1746
2050
|
if (validType) {
|
|
1747
2051
|
for (var i = 2; i < arguments.length; i++) {
|
|
1748
2052
|
validateChildKeys(arguments[i], type);
|
|
@@ -1757,16 +2061,15 @@ function createElementWithValidation(type, props, children) {
|
|
|
1757
2061
|
|
|
1758
2062
|
return element;
|
|
1759
2063
|
}
|
|
1760
|
-
|
|
1761
2064
|
function createFactoryWithValidation(type) {
|
|
1762
2065
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1763
|
-
validatedFactory.type = type;
|
|
1764
|
-
|
|
2066
|
+
validatedFactory.type = type; // Legacy hook: remove it
|
|
2067
|
+
|
|
1765
2068
|
{
|
|
1766
2069
|
Object.defineProperty(validatedFactory, 'type', {
|
|
1767
2070
|
enumerable: false,
|
|
1768
2071
|
get: function () {
|
|
1769
|
-
|
|
2072
|
+
lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
1770
2073
|
Object.defineProperty(this, 'type', {
|
|
1771
2074
|
value: type
|
|
1772
2075
|
});
|
|
@@ -1777,54 +2080,155 @@ function createFactoryWithValidation(type) {
|
|
|
1777
2080
|
|
|
1778
2081
|
return validatedFactory;
|
|
1779
2082
|
}
|
|
1780
|
-
|
|
1781
2083
|
function cloneElementWithValidation(element, props, children) {
|
|
1782
2084
|
var newElement = cloneElement.apply(this, arguments);
|
|
2085
|
+
|
|
1783
2086
|
for (var i = 2; i < arguments.length; i++) {
|
|
1784
2087
|
validateChildKeys(arguments[i], newElement.type);
|
|
1785
2088
|
}
|
|
2089
|
+
|
|
1786
2090
|
validatePropTypes(newElement);
|
|
1787
2091
|
return newElement;
|
|
1788
2092
|
}
|
|
1789
2093
|
|
|
1790
|
-
|
|
2094
|
+
var hasBadMapPolyfill;
|
|
1791
2095
|
|
|
2096
|
+
{
|
|
2097
|
+
hasBadMapPolyfill = false;
|
|
1792
2098
|
|
|
1793
|
-
|
|
2099
|
+
try {
|
|
2100
|
+
var frozenObject = Object.freeze({});
|
|
2101
|
+
var testMap = new Map([[frozenObject, null]]);
|
|
2102
|
+
var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
|
|
2103
|
+
// https://github.com/rollup/rollup/issues/1771
|
|
2104
|
+
// TODO: we can remove these if Rollup fixes the bug.
|
|
2105
|
+
|
|
2106
|
+
testMap.set(0, 0);
|
|
2107
|
+
testSet.add(0);
|
|
2108
|
+
} catch (e) {
|
|
2109
|
+
// TODO: Consider warning about bad polyfills
|
|
2110
|
+
hasBadMapPolyfill = true;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
function createFundamentalComponent(impl) {
|
|
2115
|
+
// We use responder as a Map key later on. When we have a bad
|
|
2116
|
+
// polyfill, then we can't use it as a key as the polyfill tries
|
|
2117
|
+
// to add a property to the object.
|
|
2118
|
+
if (true && !hasBadMapPolyfill) {
|
|
2119
|
+
Object.freeze(impl);
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
var fundamantalComponent = {
|
|
2123
|
+
$$typeof: REACT_FUNDAMENTAL_TYPE,
|
|
2124
|
+
impl: impl
|
|
2125
|
+
};
|
|
2126
|
+
|
|
2127
|
+
{
|
|
2128
|
+
Object.freeze(fundamantalComponent);
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
return fundamantalComponent;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
function createEventResponder(displayName, responderConfig) {
|
|
2135
|
+
var getInitialState = responderConfig.getInitialState,
|
|
2136
|
+
onEvent = responderConfig.onEvent,
|
|
2137
|
+
onMount = responderConfig.onMount,
|
|
2138
|
+
onUnmount = responderConfig.onUnmount,
|
|
2139
|
+
onRootEvent = responderConfig.onRootEvent,
|
|
2140
|
+
rootEventTypes = responderConfig.rootEventTypes,
|
|
2141
|
+
targetEventTypes = responderConfig.targetEventTypes,
|
|
2142
|
+
targetPortalPropagation = responderConfig.targetPortalPropagation;
|
|
2143
|
+
var eventResponder = {
|
|
2144
|
+
$$typeof: REACT_RESPONDER_TYPE,
|
|
2145
|
+
displayName: displayName,
|
|
2146
|
+
getInitialState: getInitialState || null,
|
|
2147
|
+
onEvent: onEvent || null,
|
|
2148
|
+
onMount: onMount || null,
|
|
2149
|
+
onRootEvent: onRootEvent || null,
|
|
2150
|
+
onUnmount: onUnmount || null,
|
|
2151
|
+
rootEventTypes: rootEventTypes || null,
|
|
2152
|
+
targetEventTypes: targetEventTypes || null,
|
|
2153
|
+
targetPortalPropagation: targetPortalPropagation || false
|
|
2154
|
+
}; // We use responder as a Map key later on. When we have a bad
|
|
2155
|
+
// polyfill, then we can't use it as a key as the polyfill tries
|
|
2156
|
+
// to add a property to the object.
|
|
2157
|
+
|
|
2158
|
+
if (true && !hasBadMapPolyfill) {
|
|
2159
|
+
Object.freeze(eventResponder);
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return eventResponder;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
function createScope() {
|
|
2166
|
+
var scopeComponent = {
|
|
2167
|
+
$$typeof: REACT_SCOPE_TYPE
|
|
2168
|
+
};
|
|
2169
|
+
|
|
2170
|
+
{
|
|
2171
|
+
Object.freeze(scopeComponent);
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
return scopeComponent;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
2178
|
+
|
|
2179
|
+
// In some cases, StrictMode should also double-render lifecycles.
|
|
1794
2180
|
// This can be confusing for tests though,
|
|
1795
2181
|
// And it can be bad for performance in production.
|
|
1796
2182
|
// This feature flag can be used to control the behavior:
|
|
1797
2183
|
|
|
1798
|
-
|
|
1799
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
2184
|
+
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
1800
2185
|
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
1801
2186
|
|
|
2187
|
+
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
1802
2188
|
|
|
1803
|
-
//
|
|
2189
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
1804
2190
|
|
|
2191
|
+
// Trace which interactions trigger each commit.
|
|
1805
2192
|
|
|
1806
|
-
//
|
|
2193
|
+
// SSR experiments
|
|
1807
2194
|
|
|
1808
2195
|
|
|
1809
|
-
//
|
|
2196
|
+
// Only used in www builds.
|
|
1810
2197
|
|
|
2198
|
+
// Only used in www builds.
|
|
1811
2199
|
|
|
1812
|
-
//
|
|
1813
|
-
// TODO: true? Here it might just be false.
|
|
2200
|
+
// Disable javascript: URL strings in href for XSS protection.
|
|
1814
2201
|
|
|
1815
|
-
//
|
|
2202
|
+
// React Fire: prevent the value and checked attributes from syncing
|
|
2203
|
+
// with their related DOM properties
|
|
1816
2204
|
|
|
2205
|
+
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
2206
|
+
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
1817
2207
|
|
|
1818
|
-
|
|
2208
|
+
var exposeConcurrentModeAPIs = false;
|
|
2209
|
+
// Experimental React Flare event system and event components support.
|
|
1819
2210
|
|
|
2211
|
+
var enableFlareAPI = false; // Experimental Host Component support.
|
|
1820
2212
|
|
|
1821
|
-
|
|
1822
|
-
// with their related DOM properties
|
|
2213
|
+
var enableFundamentalAPI = false; // Experimental Scope support.
|
|
1823
2214
|
|
|
2215
|
+
var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
1824
2216
|
|
|
1825
|
-
//
|
|
1826
|
-
//
|
|
1827
|
-
|
|
2217
|
+
var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
2218
|
+
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
2219
|
+
|
|
2220
|
+
// For tests, we flush suspense fallbacks in an act scope;
|
|
2221
|
+
// *except* in some of our own tests, where we test incremental loading states.
|
|
2222
|
+
|
|
2223
|
+
// Add a callback property to suspense to notify which promises are currently
|
|
2224
|
+
// in the update queue. This allows reporting and tracing of what is causing
|
|
2225
|
+
// the user to see a loading state.
|
|
2226
|
+
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
2227
|
+
// hydrated or deleted.
|
|
2228
|
+
|
|
2229
|
+
// Part of the simplification of React.createElement so we can eventually move
|
|
2230
|
+
// from React.createElement to React.jsx
|
|
2231
|
+
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
1828
2232
|
|
|
1829
2233
|
var React = {
|
|
1830
2234
|
Children: {
|
|
@@ -1834,16 +2238,13 @@ var React = {
|
|
|
1834
2238
|
toArray: toArray,
|
|
1835
2239
|
only: onlyChild
|
|
1836
2240
|
},
|
|
1837
|
-
|
|
1838
2241
|
createRef: createRef,
|
|
1839
2242
|
Component: Component,
|
|
1840
2243
|
PureComponent: PureComponent,
|
|
1841
|
-
|
|
1842
2244
|
createContext: createContext,
|
|
1843
2245
|
forwardRef: forwardRef,
|
|
1844
2246
|
lazy: lazy,
|
|
1845
2247
|
memo: memo,
|
|
1846
|
-
|
|
1847
2248
|
useCallback: useCallback,
|
|
1848
2249
|
useContext: useContext,
|
|
1849
2250
|
useEffect: useEffect,
|
|
@@ -1854,34 +2255,48 @@ var React = {
|
|
|
1854
2255
|
useReducer: useReducer,
|
|
1855
2256
|
useRef: useRef,
|
|
1856
2257
|
useState: useState,
|
|
1857
|
-
|
|
1858
2258
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
2259
|
+
Profiler: REACT_PROFILER_TYPE,
|
|
1859
2260
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
1860
2261
|
Suspense: REACT_SUSPENSE_TYPE,
|
|
1861
|
-
|
|
1862
2262
|
createElement: createElementWithValidation,
|
|
1863
2263
|
cloneElement: cloneElementWithValidation,
|
|
1864
2264
|
createFactory: createFactoryWithValidation,
|
|
1865
2265
|
isValidElement: isValidElement,
|
|
1866
|
-
|
|
1867
2266
|
version: ReactVersion,
|
|
1868
|
-
|
|
1869
|
-
unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
|
1870
|
-
unstable_Profiler: REACT_PROFILER_TYPE,
|
|
1871
|
-
|
|
1872
2267
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
1873
2268
|
};
|
|
1874
2269
|
|
|
1875
|
-
|
|
2270
|
+
if (exposeConcurrentModeAPIs) {
|
|
2271
|
+
React.useTransition = useTransition;
|
|
2272
|
+
React.useDeferredValue = useDeferredValue;
|
|
2273
|
+
React.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
2274
|
+
React.unstable_withSuspenseConfig = withSuspenseConfig;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
if (enableFlareAPI) {
|
|
2278
|
+
React.unstable_useResponder = useResponder;
|
|
2279
|
+
React.unstable_createResponder = createEventResponder;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
if (enableFundamentalAPI) {
|
|
2283
|
+
React.unstable_createFundamental = createFundamentalComponent;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
if (enableScopeAPI) {
|
|
2287
|
+
React.unstable_createScope = createScope;
|
|
2288
|
+
} // Note: some APIs are added with feature flags.
|
|
1876
2289
|
// Make sure that stable builds for open source
|
|
1877
2290
|
// don't modify the React object to avoid deopts.
|
|
1878
2291
|
// Also let's not expose their names in stable builds.
|
|
1879
2292
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
2293
|
+
|
|
2294
|
+
if (enableJSXTransformAPI) {
|
|
2295
|
+
{
|
|
2296
|
+
React.jsxDEV = jsxWithValidation;
|
|
2297
|
+
React.jsx = jsxWithValidationDynamic;
|
|
2298
|
+
React.jsxs = jsxWithValidationStatic;
|
|
2299
|
+
}
|
|
1885
2300
|
}
|
|
1886
2301
|
|
|
1887
2302
|
|
|
@@ -1894,6 +2309,8 @@ var React$3 = ( React$2 && React ) || React$2;
|
|
|
1894
2309
|
|
|
1895
2310
|
// TODO: decide on the top-level export form.
|
|
1896
2311
|
// This is hacky but makes it work with both Rollup and Jest.
|
|
2312
|
+
|
|
2313
|
+
|
|
1897
2314
|
var react = React$3.default || React$3;
|
|
1898
2315
|
|
|
1899
2316
|
module.exports = react;
|