react 17.0.0 → 18.0.0-alpha-e6be2d531
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-jsx-dev-runtime.development.js +60 -34
- package/cjs/react-jsx-dev-runtime.production.min.js +2 -2
- package/cjs/react-jsx-dev-runtime.profiling.min.js +2 -2
- package/cjs/react-jsx-runtime.development.js +60 -34
- package/cjs/react-jsx-runtime.production.min.js +3 -3
- package/cjs/react-jsx-runtime.profiling.min.js +3 -3
- package/cjs/react-unstable-shared-subset.development.js +18 -0
- package/cjs/react-unstable-shared-subset.production.min.js +9 -0
- package/cjs/react.development.js +176 -96
- package/cjs/react.production.min.js +15 -14
- package/package.json +18 -3
- package/umd/react.development.js +326 -826
- package/umd/react.production.min.js +22 -23
- package/umd/react.profiling.min.js +22 -30
- package/unstable-shared-subset.js +7 -0
- package/build-info.json +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React vundefined
|
|
2
2
|
* react-jsx-runtime.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=
|
|
10
|
-
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)
|
|
9
|
+
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
10
|
+
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:n.current}}exports.jsx=q;exports.jsxs=q;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React vundefined
|
|
2
2
|
* react-jsx-runtime.profiling.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=
|
|
10
|
-
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)
|
|
9
|
+
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
10
|
+
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:n.current}}exports.jsx=q;exports.jsxs=q;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @license React vundefined
|
|
2
|
+
* react-unstable-shared-subset.development.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
(function() {
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
throw new Error('This entry point is not yet supported outside of experimental channels');
|
|
17
|
+
})();
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @license React vundefined
|
|
2
|
+
* react-unstable-shared-subset.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
'use strict';throw Error("This entry point is not yet supported outside of experimental channels");
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React vundefined
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,8 +15,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
|
|
16
16
|
var _assign = require('object-assign');
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
var ReactVersion = '17.0.0';
|
|
18
|
+
var ReactVersion = '18.0.0-e6be2d531';
|
|
20
19
|
|
|
21
20
|
// ATTENTION
|
|
22
21
|
// When adding new symbols to this file,
|
|
@@ -32,17 +31,15 @@ var REACT_PROVIDER_TYPE = 0xeacd;
|
|
|
32
31
|
var REACT_CONTEXT_TYPE = 0xeace;
|
|
33
32
|
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
34
33
|
exports.Suspense = 0xead1;
|
|
35
|
-
|
|
34
|
+
exports.SuspenseList = 0xead8;
|
|
36
35
|
var REACT_MEMO_TYPE = 0xead3;
|
|
37
36
|
var REACT_LAZY_TYPE = 0xead4;
|
|
38
|
-
var REACT_BLOCK_TYPE = 0xead9;
|
|
39
|
-
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
40
|
-
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
41
37
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
42
38
|
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
43
39
|
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
44
40
|
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
45
41
|
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
42
|
+
var REACT_CACHE_TYPE = 0xeae4;
|
|
46
43
|
|
|
47
44
|
if (typeof Symbol === 'function' && Symbol.for) {
|
|
48
45
|
var symbolFor = Symbol.for;
|
|
@@ -55,17 +52,15 @@ if (typeof Symbol === 'function' && Symbol.for) {
|
|
|
55
52
|
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
56
53
|
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
57
54
|
exports.Suspense = symbolFor('react.suspense');
|
|
58
|
-
|
|
55
|
+
exports.SuspenseList = symbolFor('react.suspense_list');
|
|
59
56
|
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
60
57
|
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
61
|
-
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
62
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
63
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
64
58
|
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
65
59
|
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
66
60
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
67
61
|
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
68
62
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
63
|
+
REACT_CACHE_TYPE = symbolFor('react.cache');
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
@@ -448,16 +443,30 @@ function createRef() {
|
|
|
448
443
|
return refObject;
|
|
449
444
|
}
|
|
450
445
|
|
|
446
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
447
|
+
|
|
448
|
+
function isArray(a) {
|
|
449
|
+
return isArrayImpl(a);
|
|
450
|
+
}
|
|
451
|
+
|
|
451
452
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
453
|
+
var displayName = outerType.displayName;
|
|
454
|
+
|
|
455
|
+
if (displayName) {
|
|
456
|
+
return displayName;
|
|
457
|
+
}
|
|
458
|
+
|
|
452
459
|
var functionName = innerType.displayName || innerType.name || '';
|
|
453
|
-
return
|
|
454
|
-
}
|
|
460
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
461
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
462
|
+
|
|
455
463
|
|
|
456
464
|
function getContextName(type) {
|
|
457
465
|
return type.displayName || 'Context';
|
|
458
|
-
}
|
|
466
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
459
467
|
|
|
460
|
-
|
|
468
|
+
|
|
469
|
+
function getComponentNameFromType(type) {
|
|
461
470
|
if (type == null) {
|
|
462
471
|
// Host root, text node or just invalid type.
|
|
463
472
|
return null;
|
|
@@ -465,7 +474,7 @@ function getComponentName(type) {
|
|
|
465
474
|
|
|
466
475
|
{
|
|
467
476
|
if (typeof type.tag === 'number') {
|
|
468
|
-
error('Received an unexpected object in
|
|
477
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
469
478
|
}
|
|
470
479
|
}
|
|
471
480
|
|
|
@@ -493,8 +502,11 @@ function getComponentName(type) {
|
|
|
493
502
|
case exports.Suspense:
|
|
494
503
|
return 'Suspense';
|
|
495
504
|
|
|
496
|
-
case
|
|
505
|
+
case exports.SuspenseList:
|
|
497
506
|
return 'SuspenseList';
|
|
507
|
+
|
|
508
|
+
case REACT_CACHE_TYPE:
|
|
509
|
+
return 'Cache';
|
|
498
510
|
}
|
|
499
511
|
|
|
500
512
|
if (typeof type === 'object') {
|
|
@@ -511,10 +523,13 @@ function getComponentName(type) {
|
|
|
511
523
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
512
524
|
|
|
513
525
|
case REACT_MEMO_TYPE:
|
|
514
|
-
|
|
526
|
+
var outerName = type.displayName || null;
|
|
515
527
|
|
|
516
|
-
|
|
517
|
-
|
|
528
|
+
if (outerName !== null) {
|
|
529
|
+
return outerName;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
518
533
|
|
|
519
534
|
case REACT_LAZY_TYPE:
|
|
520
535
|
{
|
|
@@ -523,7 +538,7 @@ function getComponentName(type) {
|
|
|
523
538
|
var init = lazyComponent._init;
|
|
524
539
|
|
|
525
540
|
try {
|
|
526
|
-
return
|
|
541
|
+
return getComponentNameFromType(init(payload));
|
|
527
542
|
} catch (x) {
|
|
528
543
|
return null;
|
|
529
544
|
}
|
|
@@ -535,6 +550,7 @@ function getComponentName(type) {
|
|
|
535
550
|
}
|
|
536
551
|
|
|
537
552
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
553
|
+
|
|
538
554
|
var RESERVED_PROPS = {
|
|
539
555
|
key: true,
|
|
540
556
|
ref: true,
|
|
@@ -614,7 +630,7 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
614
630
|
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
615
631
|
{
|
|
616
632
|
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
617
|
-
var componentName =
|
|
633
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
618
634
|
|
|
619
635
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
620
636
|
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
|
@@ -966,7 +982,7 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
|
966
982
|
|
|
967
983
|
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
968
984
|
|
|
969
|
-
if (
|
|
985
|
+
if (isArray(mappedChild)) {
|
|
970
986
|
var escapedChildKey = '';
|
|
971
987
|
|
|
972
988
|
if (childKey != null) {
|
|
@@ -997,7 +1013,7 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
|
997
1013
|
|
|
998
1014
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
999
1015
|
|
|
1000
|
-
if (
|
|
1016
|
+
if (isArray(children)) {
|
|
1001
1017
|
for (var i = 0; i < children.length; i++) {
|
|
1002
1018
|
child = children[i];
|
|
1003
1019
|
nextName = nextNamePrefix + getElementKey(child, i);
|
|
@@ -1143,20 +1159,11 @@ function onlyChild(children) {
|
|
|
1143
1159
|
return children;
|
|
1144
1160
|
}
|
|
1145
1161
|
|
|
1146
|
-
function createContext(defaultValue
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
} else {
|
|
1150
|
-
{
|
|
1151
|
-
if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
|
1152
|
-
error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1162
|
+
function createContext(defaultValue) {
|
|
1163
|
+
// TODO: Second argument used to be an optional `calculateChangedBits`
|
|
1164
|
+
// function. Warn to reserve for future use?
|
|
1157
1165
|
var context = {
|
|
1158
1166
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1159
|
-
_calculateChangedBits: calculateChangedBits,
|
|
1160
1167
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1161
1168
|
// some renderers as primary and others as secondary. We only expect
|
|
1162
1169
|
// there to be two concurrent renderers at most: React Native (primary) and
|
|
@@ -1185,8 +1192,7 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1185
1192
|
// warn for the incorrect usage of Context as a Consumer.
|
|
1186
1193
|
var Consumer = {
|
|
1187
1194
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1188
|
-
_context: context
|
|
1189
|
-
_calculateChangedBits: context._calculateChangedBits
|
|
1195
|
+
_context: context
|
|
1190
1196
|
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1191
1197
|
|
|
1192
1198
|
Object.defineProperties(Consumer, {
|
|
@@ -1273,38 +1279,54 @@ function lazyInitializer(payload) {
|
|
|
1273
1279
|
if (payload._status === Uninitialized) {
|
|
1274
1280
|
var ctor = payload._result;
|
|
1275
1281
|
var thenable = ctor(); // Transition to the next state.
|
|
1282
|
+
// This might throw either because it's missing or throws. If so, we treat it
|
|
1283
|
+
// as still uninitialized and try again next time. Which is the same as what
|
|
1284
|
+
// happens if the ctor or any wrappers processing the ctor throws. This might
|
|
1285
|
+
// end up fixing it if the resolution was a concurrency bug.
|
|
1276
1286
|
|
|
1277
|
-
var pending = payload;
|
|
1278
|
-
pending._status = Pending;
|
|
1279
|
-
pending._result = thenable;
|
|
1280
1287
|
thenable.then(function (moduleObject) {
|
|
1281
|
-
if (payload._status === Pending) {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
{
|
|
1285
|
-
if (defaultExport === undefined) {
|
|
1286
|
-
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1287
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1288
|
-
}
|
|
1289
|
-
} // Transition to the next state.
|
|
1290
|
-
|
|
1291
|
-
|
|
1288
|
+
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1289
|
+
// Transition to the next state.
|
|
1292
1290
|
var resolved = payload;
|
|
1293
1291
|
resolved._status = Resolved;
|
|
1294
|
-
resolved._result =
|
|
1292
|
+
resolved._result = moduleObject;
|
|
1295
1293
|
}
|
|
1296
1294
|
}, function (error) {
|
|
1297
|
-
if (payload._status === Pending) {
|
|
1295
|
+
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1298
1296
|
// Transition to the next state.
|
|
1299
1297
|
var rejected = payload;
|
|
1300
1298
|
rejected._status = Rejected;
|
|
1301
1299
|
rejected._result = error;
|
|
1302
1300
|
}
|
|
1303
1301
|
});
|
|
1302
|
+
|
|
1303
|
+
if (payload._status === Uninitialized) {
|
|
1304
|
+
// In case, we're still uninitialized, then we're waiting for the thenable
|
|
1305
|
+
// to resolve. Set it as pending in the meantime.
|
|
1306
|
+
var pending = payload;
|
|
1307
|
+
pending._status = Pending;
|
|
1308
|
+
pending._result = thenable;
|
|
1309
|
+
}
|
|
1304
1310
|
}
|
|
1305
1311
|
|
|
1306
1312
|
if (payload._status === Resolved) {
|
|
1307
|
-
|
|
1313
|
+
var moduleObject = payload._result;
|
|
1314
|
+
|
|
1315
|
+
{
|
|
1316
|
+
if (moduleObject === undefined) {
|
|
1317
|
+
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1318
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
{
|
|
1323
|
+
if (!('default' in moduleObject)) {
|
|
1324
|
+
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1325
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
return moduleObject.default;
|
|
1308
1330
|
} else {
|
|
1309
1331
|
throw payload._result;
|
|
1310
1332
|
}
|
|
@@ -1399,9 +1421,15 @@ function forwardRef(render) {
|
|
|
1399
1421
|
return ownName;
|
|
1400
1422
|
},
|
|
1401
1423
|
set: function (name) {
|
|
1402
|
-
ownName = name;
|
|
1403
|
-
|
|
1404
|
-
|
|
1424
|
+
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1425
|
+
// because the component may be used elsewhere.
|
|
1426
|
+
// But it's nice for anonymous functions to inherit the name,
|
|
1427
|
+
// so that our component-stack generation logic will display their frames.
|
|
1428
|
+
// An anonymous function generally suggests a pattern like:
|
|
1429
|
+
// React.forwardRef((props, ref) => {...});
|
|
1430
|
+
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1431
|
+
|
|
1432
|
+
if (!render.name && !render.displayName) {
|
|
1405
1433
|
render.displayName = name;
|
|
1406
1434
|
}
|
|
1407
1435
|
}
|
|
@@ -1412,21 +1440,32 @@ function forwardRef(render) {
|
|
|
1412
1440
|
}
|
|
1413
1441
|
|
|
1414
1442
|
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1443
|
+
var enableCache = false; // Only used in www builds.
|
|
1415
1444
|
|
|
1416
1445
|
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1417
1446
|
|
|
1447
|
+
var REACT_MODULE_REFERENCE = 0;
|
|
1448
|
+
|
|
1449
|
+
if (typeof Symbol === 'function') {
|
|
1450
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1418
1453
|
function isValidElementType(type) {
|
|
1419
1454
|
if (typeof type === 'string' || typeof type === 'function') {
|
|
1420
1455
|
return true;
|
|
1421
1456
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1422
1457
|
|
|
1423
1458
|
|
|
1424
|
-
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type ===
|
|
1459
|
+
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === exports.SuspenseList || type === REACT_LEGACY_HIDDEN_TYPE || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCache ) {
|
|
1425
1460
|
return true;
|
|
1426
1461
|
}
|
|
1427
1462
|
|
|
1428
1463
|
if (typeof type === 'object' && type !== null) {
|
|
1429
|
-
if (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 ||
|
|
1464
|
+
if (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 || // This needs to include all possible module reference object
|
|
1465
|
+
// types supported by any Flight configuration anywhere since
|
|
1466
|
+
// we don't know which Flight build this will end up being used
|
|
1467
|
+
// with.
|
|
1468
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1430
1469
|
return true;
|
|
1431
1470
|
}
|
|
1432
1471
|
}
|
|
@@ -1456,9 +1495,15 @@ function memo(type, compare) {
|
|
|
1456
1495
|
return ownName;
|
|
1457
1496
|
},
|
|
1458
1497
|
set: function (name) {
|
|
1459
|
-
ownName = name;
|
|
1460
|
-
|
|
1461
|
-
|
|
1498
|
+
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1499
|
+
// because the component may be used elsewhere.
|
|
1500
|
+
// But it's nice for anonymous functions to inherit the name,
|
|
1501
|
+
// so that our component-stack generation logic will display their frames.
|
|
1502
|
+
// An anonymous function generally suggests a pattern like:
|
|
1503
|
+
// React.memo((props) => {...});
|
|
1504
|
+
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1505
|
+
|
|
1506
|
+
if (!type.name && !type.displayName) {
|
|
1462
1507
|
type.displayName = name;
|
|
1463
1508
|
}
|
|
1464
1509
|
}
|
|
@@ -1471,24 +1516,22 @@ function memo(type, compare) {
|
|
|
1471
1516
|
function resolveDispatcher() {
|
|
1472
1517
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1473
1518
|
|
|
1474
|
-
|
|
1475
|
-
{
|
|
1476
|
-
|
|
1519
|
+
{
|
|
1520
|
+
if (dispatcher === null) {
|
|
1521
|
+
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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
|
1477
1522
|
}
|
|
1478
|
-
}
|
|
1523
|
+
} // Will result in a null access error if accessed outside render phase. We
|
|
1524
|
+
// intentionally don't throw our own error because this is in a hot path.
|
|
1525
|
+
// Also helps ensure this is inlined.
|
|
1526
|
+
|
|
1479
1527
|
|
|
1480
1528
|
return dispatcher;
|
|
1481
1529
|
}
|
|
1482
|
-
|
|
1483
|
-
function useContext(Context, unstable_observedBits) {
|
|
1530
|
+
function useContext(Context) {
|
|
1484
1531
|
var dispatcher = resolveDispatcher();
|
|
1485
1532
|
|
|
1486
1533
|
{
|
|
1487
|
-
|
|
1488
|
-
error('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://reactjs.org/link/rules-of-hooks' : '');
|
|
1489
|
-
} // TODO: add a more generic warning for invalid values.
|
|
1490
|
-
|
|
1491
|
-
|
|
1534
|
+
// TODO: add a more generic warning for invalid values.
|
|
1492
1535
|
if (Context._context !== undefined) {
|
|
1493
1536
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1494
1537
|
// and nobody should be using this in existing code.
|
|
@@ -1501,7 +1544,7 @@ function useContext(Context, unstable_observedBits) {
|
|
|
1501
1544
|
}
|
|
1502
1545
|
}
|
|
1503
1546
|
|
|
1504
|
-
return dispatcher.useContext(Context
|
|
1547
|
+
return dispatcher.useContext(Context);
|
|
1505
1548
|
}
|
|
1506
1549
|
function useState(initialState) {
|
|
1507
1550
|
var dispatcher = resolveDispatcher();
|
|
@@ -1541,6 +1584,22 @@ function useDebugValue(value, formatterFn) {
|
|
|
1541
1584
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1542
1585
|
}
|
|
1543
1586
|
}
|
|
1587
|
+
function useTransition() {
|
|
1588
|
+
var dispatcher = resolveDispatcher();
|
|
1589
|
+
return dispatcher.useTransition();
|
|
1590
|
+
}
|
|
1591
|
+
function useDeferredValue(value) {
|
|
1592
|
+
var dispatcher = resolveDispatcher();
|
|
1593
|
+
return dispatcher.useDeferredValue(value);
|
|
1594
|
+
}
|
|
1595
|
+
function useOpaqueIdentifier() {
|
|
1596
|
+
var dispatcher = resolveDispatcher();
|
|
1597
|
+
return dispatcher.useOpaqueIdentifier();
|
|
1598
|
+
}
|
|
1599
|
+
function useMutableSource(source, getSnapshot, subscribe) {
|
|
1600
|
+
var dispatcher = resolveDispatcher();
|
|
1601
|
+
return dispatcher.useMutableSource(source, getSnapshot, subscribe);
|
|
1602
|
+
}
|
|
1544
1603
|
|
|
1545
1604
|
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1546
1605
|
// replaying on render function. This currently only patches the object
|
|
@@ -1664,7 +1723,7 @@ var componentFrameCache;
|
|
|
1664
1723
|
|
|
1665
1724
|
function describeNativeComponentFrame(fn, construct) {
|
|
1666
1725
|
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1667
|
-
if (!fn || reentry) {
|
|
1726
|
+
if ( !fn || reentry) {
|
|
1668
1727
|
return '';
|
|
1669
1728
|
}
|
|
1670
1729
|
|
|
@@ -1845,7 +1904,7 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
|
1845
1904
|
case exports.Suspense:
|
|
1846
1905
|
return describeBuiltInComponentFrame('Suspense');
|
|
1847
1906
|
|
|
1848
|
-
case
|
|
1907
|
+
case exports.SuspenseList:
|
|
1849
1908
|
return describeBuiltInComponentFrame('SuspenseList');
|
|
1850
1909
|
}
|
|
1851
1910
|
|
|
@@ -1858,9 +1917,6 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
|
1858
1917
|
// Memo may contain any component type so we recursively resolve it.
|
|
1859
1918
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1860
1919
|
|
|
1861
|
-
case REACT_BLOCK_TYPE:
|
|
1862
|
-
return describeFunctionComponentFrame(type._render);
|
|
1863
|
-
|
|
1864
1920
|
case REACT_LAZY_TYPE:
|
|
1865
1921
|
{
|
|
1866
1922
|
var lazyComponent = type;
|
|
@@ -1896,7 +1952,7 @@ function setCurrentlyValidatingElement(element) {
|
|
|
1896
1952
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1897
1953
|
{
|
|
1898
1954
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1899
|
-
var has = Function.call.bind(
|
|
1955
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
1900
1956
|
|
|
1901
1957
|
for (var typeSpecName in typeSpecs) {
|
|
1902
1958
|
if (has(typeSpecs, typeSpecName)) {
|
|
@@ -1961,7 +2017,7 @@ var propTypesMisspellWarningShown;
|
|
|
1961
2017
|
|
|
1962
2018
|
function getDeclarationErrorAddendum() {
|
|
1963
2019
|
if (ReactCurrentOwner.current) {
|
|
1964
|
-
var name =
|
|
2020
|
+
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1965
2021
|
|
|
1966
2022
|
if (name) {
|
|
1967
2023
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
@@ -2043,7 +2099,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
2043
2099
|
|
|
2044
2100
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
2045
2101
|
// Give the component that originally created this child.
|
|
2046
|
-
childOwner = " It was passed a child from " +
|
|
2102
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2047
2103
|
}
|
|
2048
2104
|
|
|
2049
2105
|
{
|
|
@@ -2070,7 +2126,7 @@ function validateChildKeys(node, parentType) {
|
|
|
2070
2126
|
return;
|
|
2071
2127
|
}
|
|
2072
2128
|
|
|
2073
|
-
if (
|
|
2129
|
+
if (isArray(node)) {
|
|
2074
2130
|
for (var i = 0; i < node.length; i++) {
|
|
2075
2131
|
var child = node[i];
|
|
2076
2132
|
|
|
@@ -2132,12 +2188,12 @@ function validatePropTypes(element) {
|
|
|
2132
2188
|
|
|
2133
2189
|
if (propTypes) {
|
|
2134
2190
|
// Intentionally inside to avoid triggering lazy initializers:
|
|
2135
|
-
var name =
|
|
2191
|
+
var name = getComponentNameFromType(type);
|
|
2136
2192
|
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2137
2193
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2138
2194
|
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2139
2195
|
|
|
2140
|
-
var _name =
|
|
2196
|
+
var _name = getComponentNameFromType(type);
|
|
2141
2197
|
|
|
2142
2198
|
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2143
2199
|
}
|
|
@@ -2202,10 +2258,10 @@ function createElementWithValidation(type, props, children) {
|
|
|
2202
2258
|
|
|
2203
2259
|
if (type === null) {
|
|
2204
2260
|
typeString = 'null';
|
|
2205
|
-
} else if (
|
|
2261
|
+
} else if (isArray(type)) {
|
|
2206
2262
|
typeString = 'array';
|
|
2207
2263
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2208
|
-
typeString = "<" + (
|
|
2264
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
2209
2265
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2210
2266
|
} else {
|
|
2211
2267
|
typeString = typeof type;
|
|
@@ -2281,16 +2337,34 @@ function cloneElementWithValidation(element, props, children) {
|
|
|
2281
2337
|
return newElement;
|
|
2282
2338
|
}
|
|
2283
2339
|
|
|
2284
|
-
{
|
|
2340
|
+
function createMutableSource(source, getVersion) {
|
|
2341
|
+
var mutableSource = {
|
|
2342
|
+
_getVersion: getVersion,
|
|
2343
|
+
_source: source,
|
|
2344
|
+
_workInProgressVersionPrimary: null,
|
|
2345
|
+
_workInProgressVersionSecondary: null
|
|
2346
|
+
};
|
|
2285
2347
|
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2348
|
+
{
|
|
2349
|
+
mutableSource._currentPrimaryRenderer = null;
|
|
2350
|
+
mutableSource._currentSecondaryRenderer = null; // Used to detect side effects that update a mutable source during render.
|
|
2351
|
+
// See https://github.com/facebook/react/issues/19948
|
|
2352
|
+
|
|
2353
|
+
mutableSource._currentlyRenderingFiber = null;
|
|
2354
|
+
mutableSource._initialVersionAsOfFirstRender = null;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
return mutableSource;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
function startTransition(scope) {
|
|
2361
|
+
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
2362
|
+
ReactCurrentBatchConfig.transition = 1;
|
|
2289
2363
|
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2364
|
+
try {
|
|
2365
|
+
scope();
|
|
2366
|
+
} finally {
|
|
2367
|
+
ReactCurrentBatchConfig.transition = prevTransition;
|
|
2294
2368
|
}
|
|
2295
2369
|
}
|
|
2296
2370
|
|
|
@@ -2318,9 +2392,14 @@ exports.forwardRef = forwardRef;
|
|
|
2318
2392
|
exports.isValidElement = isValidElement;
|
|
2319
2393
|
exports.lazy = lazy;
|
|
2320
2394
|
exports.memo = memo;
|
|
2395
|
+
exports.startTransition = startTransition;
|
|
2396
|
+
exports.unstable_createMutableSource = createMutableSource;
|
|
2397
|
+
exports.unstable_useMutableSource = useMutableSource;
|
|
2398
|
+
exports.unstable_useOpaqueIdentifier = useOpaqueIdentifier;
|
|
2321
2399
|
exports.useCallback = useCallback;
|
|
2322
2400
|
exports.useContext = useContext;
|
|
2323
2401
|
exports.useDebugValue = useDebugValue;
|
|
2402
|
+
exports.useDeferredValue = useDeferredValue;
|
|
2324
2403
|
exports.useEffect = useEffect;
|
|
2325
2404
|
exports.useImperativeHandle = useImperativeHandle;
|
|
2326
2405
|
exports.useLayoutEffect = useLayoutEffect;
|
|
@@ -2328,6 +2407,7 @@ exports.useMemo = useMemo;
|
|
|
2328
2407
|
exports.useReducer = useReducer;
|
|
2329
2408
|
exports.useRef = useRef;
|
|
2330
2409
|
exports.useState = useState;
|
|
2410
|
+
exports.useTransition = useTransition;
|
|
2331
2411
|
exports.version = ReactVersion;
|
|
2332
2412
|
})();
|
|
2333
2413
|
}
|