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