react 16.6.0-alpha.0 → 16.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react.development.js +107 -93
- package/cjs/react.production.min.js +16 -16
- package/package.json +2 -2
- package/umd/react.development.js +448 -175
- package/umd/react.production.min.js +24 -21
- package/umd/react.profiling.min.js +29 -26
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.0
|
|
1
|
+
/** @license React v16.6.0
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -20,7 +20,7 @@ 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.6.0
|
|
23
|
+
var ReactVersion = '16.6.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.
|
|
@@ -33,9 +33,11 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
33
33
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
34
34
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
35
35
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
36
|
-
var
|
|
36
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
37
37
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
38
|
-
var
|
|
38
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
39
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
40
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
39
41
|
|
|
40
42
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
41
43
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
@@ -51,48 +53,6 @@ function getIteratorFn(maybeIterable) {
|
|
|
51
53
|
return null;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
// Exports ReactDOM.createRoot
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Experimental error-boundary API that can recover from errors within a single
|
|
58
|
-
// render phase
|
|
59
|
-
|
|
60
|
-
// Suspense
|
|
61
|
-
var enableSuspense = false;
|
|
62
|
-
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
66
|
-
// This can be confusing for tests though,
|
|
67
|
-
// And it can be bad for performance in production.
|
|
68
|
-
// This feature flag can be used to control the behavior:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
72
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// Warn about legacy context API
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// Trace which interactions trigger each commit.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Only used in www builds.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// Only used in www builds.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
94
|
-
// with their related DOM properties
|
|
95
|
-
|
|
96
56
|
/**
|
|
97
57
|
* Use invariant() to assert state which your program assumes to be true.
|
|
98
58
|
*
|
|
@@ -533,10 +493,13 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
533
493
|
var Resolved = 1;
|
|
534
494
|
|
|
535
495
|
|
|
496
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
497
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
498
|
+
}
|
|
536
499
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
return
|
|
500
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
501
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
502
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
540
503
|
}
|
|
541
504
|
|
|
542
505
|
function getComponentName(type) {
|
|
@@ -556,8 +519,8 @@ function getComponentName(type) {
|
|
|
556
519
|
return type;
|
|
557
520
|
}
|
|
558
521
|
switch (type) {
|
|
559
|
-
case
|
|
560
|
-
return '
|
|
522
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
523
|
+
return 'ConcurrentMode';
|
|
561
524
|
case REACT_FRAGMENT_TYPE:
|
|
562
525
|
return 'Fragment';
|
|
563
526
|
case REACT_PORTAL_TYPE:
|
|
@@ -566,8 +529,8 @@ function getComponentName(type) {
|
|
|
566
529
|
return 'Profiler';
|
|
567
530
|
case REACT_STRICT_MODE_TYPE:
|
|
568
531
|
return 'StrictMode';
|
|
569
|
-
case
|
|
570
|
-
return '
|
|
532
|
+
case REACT_SUSPENSE_TYPE:
|
|
533
|
+
return 'Suspense';
|
|
571
534
|
}
|
|
572
535
|
if (typeof type === 'object') {
|
|
573
536
|
switch (type.$$typeof) {
|
|
@@ -576,16 +539,17 @@ function getComponentName(type) {
|
|
|
576
539
|
case REACT_PROVIDER_TYPE:
|
|
577
540
|
return 'Context.Provider';
|
|
578
541
|
case REACT_FORWARD_REF_TYPE:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return type.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
542
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
543
|
+
case REACT_MEMO_TYPE:
|
|
544
|
+
return getComponentName(type.type);
|
|
545
|
+
case REACT_LAZY_TYPE:
|
|
546
|
+
{
|
|
547
|
+
var thenable = type;
|
|
548
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
549
|
+
if (resolvedThenable) {
|
|
550
|
+
return getComponentName(resolvedThenable);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
589
553
|
}
|
|
590
554
|
}
|
|
591
555
|
return null;
|
|
@@ -1300,12 +1264,6 @@ function onlyChild(children) {
|
|
|
1300
1264
|
return children;
|
|
1301
1265
|
}
|
|
1302
1266
|
|
|
1303
|
-
function readContext(context, observedBits) {
|
|
1304
|
-
var dispatcher = ReactCurrentOwner.currentDispatcher;
|
|
1305
|
-
!(dispatcher !== null) ? invariant(false, 'Context.unstable_read(): Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps.') : void 0;
|
|
1306
|
-
return dispatcher.readContext(context, observedBits);
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
1267
|
function createContext(defaultValue, calculateChangedBits) {
|
|
1310
1268
|
if (calculateChangedBits === undefined) {
|
|
1311
1269
|
calculateChangedBits = null;
|
|
@@ -1327,16 +1285,69 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1327
1285
|
_currentValue2: defaultValue,
|
|
1328
1286
|
// These are circular
|
|
1329
1287
|
Provider: null,
|
|
1330
|
-
Consumer: null
|
|
1331
|
-
unstable_read: null
|
|
1288
|
+
Consumer: null
|
|
1332
1289
|
};
|
|
1333
1290
|
|
|
1334
1291
|
context.Provider = {
|
|
1335
1292
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
1336
1293
|
_context: context
|
|
1337
1294
|
};
|
|
1338
|
-
|
|
1339
|
-
|
|
1295
|
+
|
|
1296
|
+
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1297
|
+
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1298
|
+
|
|
1299
|
+
{
|
|
1300
|
+
// A separate object, but proxies back to the original context object for
|
|
1301
|
+
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
1302
|
+
// warn for the incorrect usage of Context as a Consumer.
|
|
1303
|
+
var Consumer = {
|
|
1304
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
1305
|
+
_context: context,
|
|
1306
|
+
_calculateChangedBits: context._calculateChangedBits
|
|
1307
|
+
};
|
|
1308
|
+
// $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1309
|
+
Object.defineProperties(Consumer, {
|
|
1310
|
+
Provider: {
|
|
1311
|
+
get: function () {
|
|
1312
|
+
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1313
|
+
hasWarnedAboutUsingConsumerProvider = true;
|
|
1314
|
+
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?');
|
|
1315
|
+
}
|
|
1316
|
+
return context.Provider;
|
|
1317
|
+
},
|
|
1318
|
+
set: function (_Provider) {
|
|
1319
|
+
context.Provider = _Provider;
|
|
1320
|
+
}
|
|
1321
|
+
},
|
|
1322
|
+
_currentValue: {
|
|
1323
|
+
get: function () {
|
|
1324
|
+
return context._currentValue;
|
|
1325
|
+
},
|
|
1326
|
+
set: function (_currentValue) {
|
|
1327
|
+
context._currentValue = _currentValue;
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
_currentValue2: {
|
|
1331
|
+
get: function () {
|
|
1332
|
+
return context._currentValue2;
|
|
1333
|
+
},
|
|
1334
|
+
set: function (_currentValue2) {
|
|
1335
|
+
context._currentValue2 = _currentValue2;
|
|
1336
|
+
}
|
|
1337
|
+
},
|
|
1338
|
+
Consumer: {
|
|
1339
|
+
get: function () {
|
|
1340
|
+
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1341
|
+
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1342
|
+
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?');
|
|
1343
|
+
}
|
|
1344
|
+
return context.Consumer;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
});
|
|
1348
|
+
// $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1349
|
+
context.Consumer = Consumer;
|
|
1350
|
+
}
|
|
1340
1351
|
|
|
1341
1352
|
{
|
|
1342
1353
|
context._currentRenderer = null;
|
|
@@ -1347,20 +1358,12 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1347
1358
|
}
|
|
1348
1359
|
|
|
1349
1360
|
function lazy(ctor) {
|
|
1350
|
-
var thenable = null;
|
|
1351
1361
|
return {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
// Lazily create thenable by wrapping in an extra thenable.
|
|
1355
|
-
thenable = ctor();
|
|
1356
|
-
ctor = null;
|
|
1357
|
-
}
|
|
1358
|
-
return thenable.then(resolve, reject);
|
|
1359
|
-
},
|
|
1360
|
-
|
|
1362
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
1363
|
+
_ctor: ctor,
|
|
1361
1364
|
// React uses these fields to store the result.
|
|
1362
|
-
|
|
1363
|
-
|
|
1365
|
+
_status: -1,
|
|
1366
|
+
_result: null
|
|
1364
1367
|
};
|
|
1365
1368
|
}
|
|
1366
1369
|
|
|
@@ -1388,7 +1391,20 @@ function forwardRef(render) {
|
|
|
1388
1391
|
function isValidElementType(type) {
|
|
1389
1392
|
return typeof type === 'string' || typeof type === 'function' ||
|
|
1390
1393
|
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1391
|
-
type === REACT_FRAGMENT_TYPE || type ===
|
|
1394
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
function memo(type, compare) {
|
|
1398
|
+
{
|
|
1399
|
+
if (!isValidElementType(type)) {
|
|
1400
|
+
warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
return {
|
|
1404
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
1405
|
+
type: type,
|
|
1406
|
+
compare: compare === undefined ? null : compare
|
|
1407
|
+
};
|
|
1392
1408
|
}
|
|
1393
1409
|
|
|
1394
1410
|
/**
|
|
@@ -1536,7 +1552,7 @@ function validatePropTypes(element) {
|
|
|
1536
1552
|
var name = void 0,
|
|
1537
1553
|
propTypes = void 0;
|
|
1538
1554
|
if (typeof type === 'function') {
|
|
1539
|
-
// Class or
|
|
1555
|
+
// Class or function component
|
|
1540
1556
|
name = type.displayName || type.name;
|
|
1541
1557
|
propTypes = type.propTypes;
|
|
1542
1558
|
} else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
|
|
@@ -1688,10 +1704,13 @@ var React = {
|
|
|
1688
1704
|
|
|
1689
1705
|
createContext: createContext,
|
|
1690
1706
|
forwardRef: forwardRef,
|
|
1707
|
+
lazy: lazy,
|
|
1708
|
+
memo: memo,
|
|
1691
1709
|
|
|
1692
1710
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
1693
1711
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
1694
|
-
|
|
1712
|
+
unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
|
1713
|
+
Suspense: REACT_SUSPENSE_TYPE,
|
|
1695
1714
|
unstable_Profiler: REACT_PROFILER_TYPE,
|
|
1696
1715
|
|
|
1697
1716
|
createElement: createElementWithValidation,
|
|
@@ -1704,11 +1723,6 @@ var React = {
|
|
|
1704
1723
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
1705
1724
|
};
|
|
1706
1725
|
|
|
1707
|
-
if (enableSuspense) {
|
|
1708
|
-
React.Placeholder = REACT_PLACEHOLDER_TYPE;
|
|
1709
|
-
React.lazy = lazy;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
1726
|
|
|
1713
1727
|
|
|
1714
1728
|
var React$2 = Object.freeze({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.0
|
|
1
|
+
/** @license React v16.6.0
|
|
2
2
|
* react.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
0;!(
|
|
20
|
-
function
|
|
21
|
-
var X={Children:{map:function(a,b,
|
|
22
|
-
_currentValue:a,_currentValue2:a,Provider:null,Consumer:null
|
|
23
|
-
var
|
|
24
|
-
assign:
|
|
10
|
+
'use strict';var k=require("object-assign"),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,z=n?Symbol.for("react.suspense"):60113,A=n?Symbol.for("react.memo"):
|
|
11
|
+
60115,B=n?Symbol.for("react.lazy"):60116,C="function"===typeof Symbol&&Symbol.iterator;function aa(a,b,e,c,d,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,c,d,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
|
12
|
+
function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)e+="&args[]="+encodeURIComponent(arguments[c+1]);aa(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F={};
|
|
13
|
+
function G(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}G.prototype.isReactComponent={};G.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?D("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};G.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function H(){}H.prototype=G.prototype;function I(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}var J=I.prototype=new H;
|
|
14
|
+
J.constructor=I;k(J,G.prototype);J.isPureReactComponent=!0;var K={current:null,currentDispatcher:null},L=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0};
|
|
15
|
+
function N(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var l=Array(f),m=0;m<f;m++)l[m]=arguments[m+2];d.children=l}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:p,type:a,key:g,ref:h,props:d,_owner:K.current}}
|
|
16
|
+
function ba(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g,Q=[];function R(a,b,e,c){if(Q.length){var d=Q.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}
|
|
17
|
+
function S(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>Q.length&&Q.push(a)}
|
|
18
|
+
function T(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return e(c,a,""===b?"."+U(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+U(d,h);g+=T(d,f,e,c)}else if(null===a||"object"!==typeof a?f=null:(f=C&&a[C]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),h=
|
|
19
|
+
0;!(d=a.next()).done;)d=d.value,f=b+U(d,h++),g+=T(d,f,e,c);else"object"===d&&(e=""+a,D("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function V(a,b,e){return null==a?0:T(a,"",b,e)}function U(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++)}
|
|
20
|
+
function da(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?W(a,c,e,function(a){return a}):null!=a&&(O(a)&&(a=ba(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+e)),c.push(a))}function W(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(P,"$&/")+"/");b=R(b,g,c,d);V(a,da,b);S(b)}
|
|
21
|
+
var X={Children:{map:function(a,b,e){if(null==a)return a;var c=[];W(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=R(null,null,b,e);V(a,ca,b);S(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){O(a)?void 0:D("143");return a}},createRef:function(){return{current:null}},Component:G,PureComponent:I,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
|
|
22
|
+
_currentValue:a,_currentValue2:a,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:y,render:a}},lazy:function(a){return{$$typeof:B,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:A,type:a,compare:void 0===b?null:b}},Fragment:r,StrictMode:t,unstable_ConcurrentMode:x,Suspense:z,unstable_Profiler:u,createElement:N,cloneElement:function(a,b,e){null===a||void 0===a?D("267",a):void 0;var c=void 0,d=k({},a.props),
|
|
23
|
+
g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,f=K.current);void 0!==b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:p,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=N.bind(null,a);b.type=a;return b},
|
|
24
|
+
isValidElement:O,version:"16.6.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:K,assign:k}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
7
|
-
"version": "16.6.0
|
|
7
|
+
"version": "16.6.0",
|
|
8
8
|
"homepage": "https://reactjs.org/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"loose-envify": "^1.1.0",
|
|
25
25
|
"object-assign": "^4.1.1",
|
|
26
26
|
"prop-types": "^15.6.2",
|
|
27
|
-
"
|
|
27
|
+
"scheduler": "^0.10.0"
|
|
28
28
|
},
|
|
29
29
|
"browserify": {
|
|
30
30
|
"transform": [
|
package/umd/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.6.0
|
|
1
|
+
/** @license React v16.6.0
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
// TODO: this is special because it gets imported during build.
|
|
19
19
|
|
|
20
|
-
var ReactVersion = '16.6.0
|
|
20
|
+
var ReactVersion = '16.6.0';
|
|
21
21
|
|
|
22
22
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
23
23
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -30,9 +30,11 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
30
30
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
31
31
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
32
32
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
33
|
-
var
|
|
33
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
34
34
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
35
|
-
var
|
|
35
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
36
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
37
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
36
38
|
|
|
37
39
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
38
40
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
@@ -48,48 +50,6 @@ function getIteratorFn(maybeIterable) {
|
|
|
48
50
|
return null;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
// Exports ReactDOM.createRoot
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// Experimental error-boundary API that can recover from errors within a single
|
|
55
|
-
// render phase
|
|
56
|
-
|
|
57
|
-
// Suspense
|
|
58
|
-
var enableSuspense = false;
|
|
59
|
-
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
63
|
-
// This can be confusing for tests though,
|
|
64
|
-
// And it can be bad for performance in production.
|
|
65
|
-
// This feature flag can be used to control the behavior:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
69
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// Warn about legacy context API
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// Trace which interactions trigger each commit.
|
|
82
|
-
var enableSchedulerTracing = true;
|
|
83
|
-
|
|
84
|
-
// Only used in www builds.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// Only used in www builds.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
91
|
-
// with their related DOM properties
|
|
92
|
-
|
|
93
53
|
/*
|
|
94
54
|
object-assign
|
|
95
55
|
(c) Sindre Sorhus
|
|
@@ -577,14 +537,34 @@ function createRef() {
|
|
|
577
537
|
|
|
578
538
|
/* eslint-disable no-var */
|
|
579
539
|
|
|
580
|
-
// TODO:
|
|
581
|
-
|
|
582
|
-
var
|
|
540
|
+
// TODO: Use symbols?
|
|
541
|
+
var ImmediatePriority = 1;
|
|
542
|
+
var UserBlockingPriority = 2;
|
|
543
|
+
var NormalPriority = 3;
|
|
544
|
+
var IdlePriority = 4;
|
|
545
|
+
|
|
546
|
+
// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
|
|
547
|
+
// Math.pow(2, 30) - 1
|
|
548
|
+
// 0b111111111111111111111111111111
|
|
549
|
+
var maxSigned31BitInt = 1073741823;
|
|
550
|
+
|
|
551
|
+
// Times out immediately
|
|
552
|
+
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
|
|
553
|
+
// Eventually times out
|
|
554
|
+
var USER_BLOCKING_PRIORITY = 250;
|
|
555
|
+
var NORMAL_PRIORITY_TIMEOUT = 5000;
|
|
556
|
+
// Never times out
|
|
557
|
+
var IDLE_PRIORITY = maxSigned31BitInt;
|
|
583
558
|
|
|
584
559
|
// Callbacks are stored as a circular, doubly linked list.
|
|
585
560
|
var firstCallbackNode = null;
|
|
586
561
|
|
|
587
|
-
var
|
|
562
|
+
var currentPriorityLevel = NormalPriority;
|
|
563
|
+
var currentEventStartTime = -1;
|
|
564
|
+
var currentExpirationTime = -1;
|
|
565
|
+
|
|
566
|
+
// This is set when a callback is being executed, to prevent re-entrancy.
|
|
567
|
+
var isExecutingCallback = false;
|
|
588
568
|
|
|
589
569
|
var isHostCallbackScheduled = false;
|
|
590
570
|
|
|
@@ -593,6 +573,11 @@ var hasNativePerformanceNow = typeof performance === 'object' && typeof performa
|
|
|
593
573
|
var timeRemaining;
|
|
594
574
|
if (hasNativePerformanceNow) {
|
|
595
575
|
timeRemaining = function () {
|
|
576
|
+
if (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime) {
|
|
577
|
+
// A higher priority callback was scheduled. Yield so we can switch to
|
|
578
|
+
// working on that.
|
|
579
|
+
return 0;
|
|
580
|
+
}
|
|
596
581
|
// We assume that if we have a performance timer that the rAF callback
|
|
597
582
|
// gets a performance timer value. Not sure if this is always true.
|
|
598
583
|
var remaining = getFrameDeadline() - performance.now();
|
|
@@ -601,6 +586,9 @@ if (hasNativePerformanceNow) {
|
|
|
601
586
|
} else {
|
|
602
587
|
timeRemaining = function () {
|
|
603
588
|
// Fallback to Date.now()
|
|
589
|
+
if (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime) {
|
|
590
|
+
return 0;
|
|
591
|
+
}
|
|
604
592
|
var remaining = getFrameDeadline() - Date.now();
|
|
605
593
|
return remaining > 0 ? remaining : 0;
|
|
606
594
|
};
|
|
@@ -612,22 +600,22 @@ var deadlineObject = {
|
|
|
612
600
|
};
|
|
613
601
|
|
|
614
602
|
function ensureHostCallbackIsScheduled() {
|
|
615
|
-
if (
|
|
603
|
+
if (isExecutingCallback) {
|
|
616
604
|
// Don't schedule work yet; wait until the next time we yield.
|
|
617
605
|
return;
|
|
618
606
|
}
|
|
619
|
-
// Schedule the host callback using the earliest
|
|
620
|
-
var
|
|
607
|
+
// Schedule the host callback using the earliest expiration in the list.
|
|
608
|
+
var expirationTime = firstCallbackNode.expirationTime;
|
|
621
609
|
if (!isHostCallbackScheduled) {
|
|
622
610
|
isHostCallbackScheduled = true;
|
|
623
611
|
} else {
|
|
624
612
|
// Cancel the existing host callback.
|
|
625
|
-
|
|
613
|
+
cancelHostCallback();
|
|
626
614
|
}
|
|
627
|
-
|
|
615
|
+
requestHostCallback(flushWork, expirationTime);
|
|
628
616
|
}
|
|
629
617
|
|
|
630
|
-
function flushFirstCallback(
|
|
618
|
+
function flushFirstCallback() {
|
|
631
619
|
var flushedNode = firstCallbackNode;
|
|
632
620
|
|
|
633
621
|
// Remove the node from the list before calling the callback. That way the
|
|
@@ -638,33 +626,117 @@ function flushFirstCallback(node) {
|
|
|
638
626
|
firstCallbackNode = null;
|
|
639
627
|
next = null;
|
|
640
628
|
} else {
|
|
641
|
-
var
|
|
642
|
-
firstCallbackNode =
|
|
643
|
-
next.previous =
|
|
629
|
+
var lastCallbackNode = firstCallbackNode.previous;
|
|
630
|
+
firstCallbackNode = lastCallbackNode.next = next;
|
|
631
|
+
next.previous = lastCallbackNode;
|
|
644
632
|
}
|
|
645
633
|
|
|
646
634
|
flushedNode.next = flushedNode.previous = null;
|
|
647
635
|
|
|
648
636
|
// Now it's safe to call the callback.
|
|
649
637
|
var callback = flushedNode.callback;
|
|
650
|
-
|
|
638
|
+
var expirationTime = flushedNode.expirationTime;
|
|
639
|
+
var priorityLevel = flushedNode.priorityLevel;
|
|
640
|
+
var previousPriorityLevel = currentPriorityLevel;
|
|
641
|
+
var previousExpirationTime = currentExpirationTime;
|
|
642
|
+
currentPriorityLevel = priorityLevel;
|
|
643
|
+
currentExpirationTime = expirationTime;
|
|
644
|
+
var continuationCallback;
|
|
645
|
+
try {
|
|
646
|
+
continuationCallback = callback(deadlineObject);
|
|
647
|
+
} finally {
|
|
648
|
+
currentPriorityLevel = previousPriorityLevel;
|
|
649
|
+
currentExpirationTime = previousExpirationTime;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// A callback may return a continuation. The continuation should be scheduled
|
|
653
|
+
// with the same priority and expiration as the just-finished callback.
|
|
654
|
+
if (typeof continuationCallback === 'function') {
|
|
655
|
+
var continuationNode = {
|
|
656
|
+
callback: continuationCallback,
|
|
657
|
+
priorityLevel: priorityLevel,
|
|
658
|
+
expirationTime: expirationTime,
|
|
659
|
+
next: null,
|
|
660
|
+
previous: null
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// Insert the new callback into the list, sorted by its expiration. This is
|
|
664
|
+
// almost the same as the code in `scheduleCallback`, except the callback
|
|
665
|
+
// is inserted into the list *before* callbacks of equal expiration instead
|
|
666
|
+
// of after.
|
|
667
|
+
if (firstCallbackNode === null) {
|
|
668
|
+
// This is the first callback in the list.
|
|
669
|
+
firstCallbackNode = continuationNode.next = continuationNode.previous = continuationNode;
|
|
670
|
+
} else {
|
|
671
|
+
var nextAfterContinuation = null;
|
|
672
|
+
var node = firstCallbackNode;
|
|
673
|
+
do {
|
|
674
|
+
if (node.expirationTime >= expirationTime) {
|
|
675
|
+
// This callback expires at or after the continuation. We will insert
|
|
676
|
+
// the continuation *before* this callback.
|
|
677
|
+
nextAfterContinuation = node;
|
|
678
|
+
break;
|
|
679
|
+
}
|
|
680
|
+
node = node.next;
|
|
681
|
+
} while (node !== firstCallbackNode);
|
|
682
|
+
|
|
683
|
+
if (nextAfterContinuation === null) {
|
|
684
|
+
// No equal or lower priority callback was found, which means the new
|
|
685
|
+
// callback is the lowest priority callback in the list.
|
|
686
|
+
nextAfterContinuation = firstCallbackNode;
|
|
687
|
+
} else if (nextAfterContinuation === firstCallbackNode) {
|
|
688
|
+
// The new callback is the highest priority callback in the list.
|
|
689
|
+
firstCallbackNode = continuationNode;
|
|
690
|
+
ensureHostCallbackIsScheduled();
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
var previous = nextAfterContinuation.previous;
|
|
694
|
+
previous.next = nextAfterContinuation.previous = continuationNode;
|
|
695
|
+
continuationNode.next = nextAfterContinuation;
|
|
696
|
+
continuationNode.previous = previous;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function flushImmediateWork() {
|
|
702
|
+
if (
|
|
703
|
+
// Confirm we've exited the outer most event handler
|
|
704
|
+
currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) {
|
|
705
|
+
isExecutingCallback = true;
|
|
706
|
+
deadlineObject.didTimeout = true;
|
|
707
|
+
try {
|
|
708
|
+
do {
|
|
709
|
+
flushFirstCallback();
|
|
710
|
+
} while (
|
|
711
|
+
// Keep flushing until there are no more immediate callbacks
|
|
712
|
+
firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority);
|
|
713
|
+
} finally {
|
|
714
|
+
isExecutingCallback = false;
|
|
715
|
+
if (firstCallbackNode !== null) {
|
|
716
|
+
// There's still work remaining. Request another callback.
|
|
717
|
+
ensureHostCallbackIsScheduled();
|
|
718
|
+
} else {
|
|
719
|
+
isHostCallbackScheduled = false;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
651
723
|
}
|
|
652
724
|
|
|
653
725
|
function flushWork(didTimeout) {
|
|
654
|
-
|
|
726
|
+
isExecutingCallback = true;
|
|
655
727
|
deadlineObject.didTimeout = didTimeout;
|
|
656
728
|
try {
|
|
657
729
|
if (didTimeout) {
|
|
658
|
-
// Flush all the
|
|
730
|
+
// Flush all the expired callbacks without yielding.
|
|
659
731
|
while (firstCallbackNode !== null) {
|
|
660
732
|
// Read the current time. Flush all the callbacks that expire at or
|
|
661
733
|
// earlier than that time. Then read the current time again and repeat.
|
|
662
734
|
// This optimizes for as few performance.now calls as possible.
|
|
663
735
|
var currentTime = getCurrentTime();
|
|
664
|
-
if (firstCallbackNode.
|
|
736
|
+
if (firstCallbackNode.expirationTime <= currentTime) {
|
|
665
737
|
do {
|
|
666
738
|
flushFirstCallback();
|
|
667
|
-
} while (firstCallbackNode !== null && firstCallbackNode.
|
|
739
|
+
} while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime);
|
|
668
740
|
continue;
|
|
669
741
|
}
|
|
670
742
|
break;
|
|
@@ -678,46 +750,109 @@ function flushWork(didTimeout) {
|
|
|
678
750
|
}
|
|
679
751
|
}
|
|
680
752
|
} finally {
|
|
681
|
-
|
|
753
|
+
isExecutingCallback = false;
|
|
682
754
|
if (firstCallbackNode !== null) {
|
|
683
755
|
// There's still work remaining. Request another callback.
|
|
684
|
-
ensureHostCallbackIsScheduled(
|
|
756
|
+
ensureHostCallbackIsScheduled();
|
|
685
757
|
} else {
|
|
686
758
|
isHostCallbackScheduled = false;
|
|
687
759
|
}
|
|
760
|
+
// Before exiting, flush all the immediate work that was scheduled.
|
|
761
|
+
flushImmediateWork();
|
|
688
762
|
}
|
|
689
763
|
}
|
|
690
764
|
|
|
691
|
-
function
|
|
692
|
-
|
|
765
|
+
function unstable_runWithPriority(priorityLevel, eventHandler) {
|
|
766
|
+
switch (priorityLevel) {
|
|
767
|
+
case ImmediatePriority:
|
|
768
|
+
case UserBlockingPriority:
|
|
769
|
+
case NormalPriority:
|
|
770
|
+
case IdlePriority:
|
|
771
|
+
break;
|
|
772
|
+
default:
|
|
773
|
+
priorityLevel = NormalPriority;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
var previousPriorityLevel = currentPriorityLevel;
|
|
777
|
+
var previousEventStartTime = currentEventStartTime;
|
|
778
|
+
currentPriorityLevel = priorityLevel;
|
|
779
|
+
currentEventStartTime = getCurrentTime();
|
|
693
780
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
781
|
+
try {
|
|
782
|
+
return eventHandler();
|
|
783
|
+
} finally {
|
|
784
|
+
currentPriorityLevel = previousPriorityLevel;
|
|
785
|
+
currentEventStartTime = previousEventStartTime;
|
|
786
|
+
|
|
787
|
+
// Before exiting, flush all the immediate work that was scheduled.
|
|
788
|
+
flushImmediateWork();
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function unstable_wrapCallback(callback) {
|
|
793
|
+
var parentPriorityLevel = currentPriorityLevel;
|
|
794
|
+
return function () {
|
|
795
|
+
// This is a fork of runWithPriority, inlined for performance.
|
|
796
|
+
var previousPriorityLevel = currentPriorityLevel;
|
|
797
|
+
var previousEventStartTime = currentEventStartTime;
|
|
798
|
+
currentPriorityLevel = parentPriorityLevel;
|
|
799
|
+
currentEventStartTime = getCurrentTime();
|
|
800
|
+
|
|
801
|
+
try {
|
|
802
|
+
return callback.apply(this, arguments);
|
|
803
|
+
} finally {
|
|
804
|
+
currentPriorityLevel = previousPriorityLevel;
|
|
805
|
+
currentEventStartTime = previousEventStartTime;
|
|
806
|
+
flushImmediateWork();
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function unstable_scheduleCallback(callback, deprecated_options) {
|
|
812
|
+
var startTime = currentEventStartTime !== -1 ? currentEventStartTime : getCurrentTime();
|
|
813
|
+
|
|
814
|
+
var expirationTime;
|
|
815
|
+
if (typeof deprecated_options === 'object' && deprecated_options !== null && typeof deprecated_options.timeout === 'number') {
|
|
816
|
+
// FIXME: Remove this branch once we lift expiration times out of React.
|
|
817
|
+
expirationTime = startTime + deprecated_options.timeout;
|
|
698
818
|
} else {
|
|
699
|
-
|
|
700
|
-
|
|
819
|
+
switch (currentPriorityLevel) {
|
|
820
|
+
case ImmediatePriority:
|
|
821
|
+
expirationTime = startTime + IMMEDIATE_PRIORITY_TIMEOUT;
|
|
822
|
+
break;
|
|
823
|
+
case UserBlockingPriority:
|
|
824
|
+
expirationTime = startTime + USER_BLOCKING_PRIORITY;
|
|
825
|
+
break;
|
|
826
|
+
case IdlePriority:
|
|
827
|
+
expirationTime = startTime + IDLE_PRIORITY;
|
|
828
|
+
break;
|
|
829
|
+
case NormalPriority:
|
|
830
|
+
default:
|
|
831
|
+
expirationTime = startTime + NORMAL_PRIORITY_TIMEOUT;
|
|
832
|
+
}
|
|
701
833
|
}
|
|
702
834
|
|
|
703
835
|
var newNode = {
|
|
704
836
|
callback: callback,
|
|
705
|
-
|
|
837
|
+
priorityLevel: currentPriorityLevel,
|
|
838
|
+
expirationTime: expirationTime,
|
|
706
839
|
next: null,
|
|
707
840
|
previous: null
|
|
708
841
|
};
|
|
709
842
|
|
|
710
|
-
// Insert the new callback into the list,
|
|
843
|
+
// Insert the new callback into the list, ordered first by expiration, then
|
|
844
|
+
// by insertion. So the new callback is inserted any other callback with
|
|
845
|
+
// equal expiration.
|
|
711
846
|
if (firstCallbackNode === null) {
|
|
712
847
|
// This is the first callback in the list.
|
|
713
848
|
firstCallbackNode = newNode.next = newNode.previous = newNode;
|
|
714
|
-
ensureHostCallbackIsScheduled(
|
|
849
|
+
ensureHostCallbackIsScheduled();
|
|
715
850
|
} else {
|
|
716
851
|
var next = null;
|
|
717
852
|
var node = firstCallbackNode;
|
|
718
853
|
do {
|
|
719
|
-
if (node.
|
|
720
|
-
// The new callback
|
|
854
|
+
if (node.expirationTime > expirationTime) {
|
|
855
|
+
// The new callback expires before this one.
|
|
721
856
|
next = node;
|
|
722
857
|
break;
|
|
723
858
|
}
|
|
@@ -725,13 +860,13 @@ function unstable_scheduleWork(callback, options) {
|
|
|
725
860
|
} while (node !== firstCallbackNode);
|
|
726
861
|
|
|
727
862
|
if (next === null) {
|
|
728
|
-
// No callback with a later
|
|
729
|
-
// callback has the latest
|
|
863
|
+
// No callback with a later expiration was found, which means the new
|
|
864
|
+
// callback has the latest expiration in the list.
|
|
730
865
|
next = firstCallbackNode;
|
|
731
866
|
} else if (next === firstCallbackNode) {
|
|
732
|
-
// The new callback has the earliest
|
|
867
|
+
// The new callback has the earliest expiration in the entire list.
|
|
733
868
|
firstCallbackNode = newNode;
|
|
734
|
-
ensureHostCallbackIsScheduled(
|
|
869
|
+
ensureHostCallbackIsScheduled();
|
|
735
870
|
}
|
|
736
871
|
|
|
737
872
|
var previous = next.previous;
|
|
@@ -743,7 +878,7 @@ function unstable_scheduleWork(callback, options) {
|
|
|
743
878
|
return newNode;
|
|
744
879
|
}
|
|
745
880
|
|
|
746
|
-
function
|
|
881
|
+
function unstable_cancelCallback(callbackNode) {
|
|
747
882
|
var next = callbackNode.next;
|
|
748
883
|
if (next === null) {
|
|
749
884
|
// Already cancelled.
|
|
@@ -766,6 +901,10 @@ function unstable_cancelScheduledWork(callbackNode) {
|
|
|
766
901
|
callbackNode.next = callbackNode.previous = null;
|
|
767
902
|
}
|
|
768
903
|
|
|
904
|
+
function unstable_getCurrentPriorityLevel() {
|
|
905
|
+
return currentPriorityLevel;
|
|
906
|
+
}
|
|
907
|
+
|
|
769
908
|
// The remaining code is essentially a polyfill for requestIdleCallback. It
|
|
770
909
|
// works by scheduling a requestAnimationFrame, storing the time for the start
|
|
771
910
|
// of the frame, then scheduling a postMessage which gets scheduled after paint.
|
|
@@ -826,31 +965,59 @@ if (hasNativePerformanceNow) {
|
|
|
826
965
|
};
|
|
827
966
|
}
|
|
828
967
|
|
|
829
|
-
var
|
|
830
|
-
var
|
|
968
|
+
var requestHostCallback;
|
|
969
|
+
var cancelHostCallback;
|
|
831
970
|
var getFrameDeadline;
|
|
832
971
|
|
|
833
|
-
if (typeof window
|
|
834
|
-
//
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
972
|
+
if (typeof window !== 'undefined' && window._schedMock) {
|
|
973
|
+
// Dynamic injection, only for testing purposes.
|
|
974
|
+
var impl = window._schedMock;
|
|
975
|
+
requestHostCallback = impl[0];
|
|
976
|
+
cancelHostCallback = impl[1];
|
|
977
|
+
getFrameDeadline = impl[2];
|
|
978
|
+
} else if (
|
|
979
|
+
// If Scheduler runs in a non-DOM environment, it falls back to a naive
|
|
980
|
+
// implementation using setTimeout.
|
|
981
|
+
typeof window === 'undefined' ||
|
|
982
|
+
// "addEventListener" might not be available on the window object
|
|
983
|
+
// if this is a mocked "window" object. So we need to validate that too.
|
|
984
|
+
typeof window.addEventListener !== 'function') {
|
|
985
|
+
var _callback = null;
|
|
986
|
+
var _currentTime = -1;
|
|
987
|
+
var _flushCallback = function (didTimeout, ms) {
|
|
988
|
+
if (_callback !== null) {
|
|
989
|
+
var cb = _callback;
|
|
990
|
+
_callback = null;
|
|
991
|
+
try {
|
|
992
|
+
_currentTime = ms;
|
|
993
|
+
cb(didTimeout);
|
|
994
|
+
} finally {
|
|
995
|
+
_currentTime = -1;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
839
998
|
};
|
|
840
|
-
|
|
841
|
-
|
|
999
|
+
requestHostCallback = function (cb, ms) {
|
|
1000
|
+
if (_currentTime !== -1) {
|
|
1001
|
+
// Protect against re-entrancy.
|
|
1002
|
+
setTimeout(requestHostCallback, 0, cb, ms);
|
|
1003
|
+
} else {
|
|
1004
|
+
_callback = cb;
|
|
1005
|
+
setTimeout(_flushCallback, ms, true, ms);
|
|
1006
|
+
setTimeout(_flushCallback, maxSigned31BitInt, false, maxSigned31BitInt);
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
cancelHostCallback = function () {
|
|
1010
|
+
_callback = null;
|
|
842
1011
|
};
|
|
843
1012
|
getFrameDeadline = function () {
|
|
844
|
-
return
|
|
1013
|
+
return Infinity;
|
|
1014
|
+
};
|
|
1015
|
+
getCurrentTime = function () {
|
|
1016
|
+
return _currentTime === -1 ? 0 : _currentTime;
|
|
845
1017
|
};
|
|
846
|
-
} else if (window._schedMock) {
|
|
847
|
-
// Dynamic injection, only for testing purposes.
|
|
848
|
-
var impl = window._schedMock;
|
|
849
|
-
requestCallback = impl[0];
|
|
850
|
-
cancelCallback = impl[1];
|
|
851
|
-
getFrameDeadline = impl[2];
|
|
852
1018
|
} else {
|
|
853
1019
|
if (typeof console !== 'undefined') {
|
|
1020
|
+
// TODO: Remove fb.me link
|
|
854
1021
|
if (typeof localRequestAnimationFrame !== 'function') {
|
|
855
1022
|
console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
|
|
856
1023
|
}
|
|
@@ -859,13 +1026,13 @@ if (typeof window === 'undefined') {
|
|
|
859
1026
|
}
|
|
860
1027
|
}
|
|
861
1028
|
|
|
862
|
-
var
|
|
863
|
-
var
|
|
1029
|
+
var scheduledHostCallback = null;
|
|
1030
|
+
var isMessageEventScheduled = false;
|
|
864
1031
|
var timeoutTime = -1;
|
|
865
1032
|
|
|
866
1033
|
var isAnimationFrameScheduled = false;
|
|
867
1034
|
|
|
868
|
-
var
|
|
1035
|
+
var isFlushingHostCallback = false;
|
|
869
1036
|
|
|
870
1037
|
var frameDeadline = 0;
|
|
871
1038
|
// We start out assuming that we run at 30fps but then the heuristic tracking
|
|
@@ -885,7 +1052,12 @@ if (typeof window === 'undefined') {
|
|
|
885
1052
|
return;
|
|
886
1053
|
}
|
|
887
1054
|
|
|
888
|
-
|
|
1055
|
+
isMessageEventScheduled = false;
|
|
1056
|
+
|
|
1057
|
+
var prevScheduledCallback = scheduledHostCallback;
|
|
1058
|
+
var prevTimeoutTime = timeoutTime;
|
|
1059
|
+
scheduledHostCallback = null;
|
|
1060
|
+
timeoutTime = -1;
|
|
889
1061
|
|
|
890
1062
|
var currentTime = getCurrentTime();
|
|
891
1063
|
|
|
@@ -893,7 +1065,7 @@ if (typeof window === 'undefined') {
|
|
|
893
1065
|
if (frameDeadline - currentTime <= 0) {
|
|
894
1066
|
// There's no time left in this idle period. Check if the callback has
|
|
895
1067
|
// a timeout and whether it's been exceeded.
|
|
896
|
-
if (
|
|
1068
|
+
if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) {
|
|
897
1069
|
// Exceeded the timeout. Invoke the callback even though there's no
|
|
898
1070
|
// time left.
|
|
899
1071
|
didTimeout = true;
|
|
@@ -905,19 +1077,18 @@ if (typeof window === 'undefined') {
|
|
|
905
1077
|
requestAnimationFrameWithTimeout(animationTick);
|
|
906
1078
|
}
|
|
907
1079
|
// Exit without invoking the callback.
|
|
1080
|
+
scheduledHostCallback = prevScheduledCallback;
|
|
1081
|
+
timeoutTime = prevTimeoutTime;
|
|
908
1082
|
return;
|
|
909
1083
|
}
|
|
910
1084
|
}
|
|
911
1085
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
scheduledCallback = null;
|
|
915
|
-
if (callback !== null) {
|
|
916
|
-
isPerformingIdleWork = true;
|
|
1086
|
+
if (prevScheduledCallback !== null) {
|
|
1087
|
+
isFlushingHostCallback = true;
|
|
917
1088
|
try {
|
|
918
|
-
|
|
1089
|
+
prevScheduledCallback(didTimeout);
|
|
919
1090
|
} finally {
|
|
920
|
-
|
|
1091
|
+
isFlushingHostCallback = false;
|
|
921
1092
|
}
|
|
922
1093
|
}
|
|
923
1094
|
};
|
|
@@ -926,12 +1097,27 @@ if (typeof window === 'undefined') {
|
|
|
926
1097
|
window.addEventListener('message', idleTick, false);
|
|
927
1098
|
|
|
928
1099
|
var animationTick = function (rafTime) {
|
|
929
|
-
|
|
1100
|
+
if (scheduledHostCallback !== null) {
|
|
1101
|
+
// Eagerly schedule the next animation callback at the beginning of the
|
|
1102
|
+
// frame. If the scheduler queue is not empty at the end of the frame, it
|
|
1103
|
+
// will continue flushing inside that callback. If the queue *is* empty,
|
|
1104
|
+
// then it will exit immediately. Posting the callback at the start of the
|
|
1105
|
+
// frame ensures it's fired within the earliest possible frame. If we
|
|
1106
|
+
// waited until the end of the frame to post the callback, we risk the
|
|
1107
|
+
// browser skipping a frame and not firing the callback until the frame
|
|
1108
|
+
// after that.
|
|
1109
|
+
requestAnimationFrameWithTimeout(animationTick);
|
|
1110
|
+
} else {
|
|
1111
|
+
// No pending work. Exit.
|
|
1112
|
+
isAnimationFrameScheduled = false;
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
930
1116
|
var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
|
|
931
1117
|
if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
|
|
932
1118
|
if (nextFrameTime < 8) {
|
|
933
1119
|
// Defensive coding. We don't support higher frame rates than 120hz.
|
|
934
|
-
// If
|
|
1120
|
+
// If the calculated frame time gets lower than 8, it is probably a bug.
|
|
935
1121
|
nextFrameTime = 8;
|
|
936
1122
|
}
|
|
937
1123
|
// If one frame goes long, then the next one can be short to catch up.
|
|
@@ -946,17 +1132,16 @@ if (typeof window === 'undefined') {
|
|
|
946
1132
|
previousFrameTime = nextFrameTime;
|
|
947
1133
|
}
|
|
948
1134
|
frameDeadline = rafTime + activeFrameTime;
|
|
949
|
-
if (!
|
|
950
|
-
|
|
1135
|
+
if (!isMessageEventScheduled) {
|
|
1136
|
+
isMessageEventScheduled = true;
|
|
951
1137
|
window.postMessage(messageKey, '*');
|
|
952
1138
|
}
|
|
953
1139
|
};
|
|
954
1140
|
|
|
955
|
-
|
|
956
|
-
|
|
1141
|
+
requestHostCallback = function (callback, absoluteTimeout) {
|
|
1142
|
+
scheduledHostCallback = callback;
|
|
957
1143
|
timeoutTime = absoluteTimeout;
|
|
958
|
-
if (
|
|
959
|
-
// If we're already performing idle work, an error must have been thrown.
|
|
1144
|
+
if (isFlushingHostCallback || absoluteTimeout < 0) {
|
|
960
1145
|
// Don't wait for the next frame. Continue working ASAP, in a new event.
|
|
961
1146
|
window.postMessage(messageKey, '*');
|
|
962
1147
|
} else if (!isAnimationFrameScheduled) {
|
|
@@ -969,13 +1154,44 @@ if (typeof window === 'undefined') {
|
|
|
969
1154
|
}
|
|
970
1155
|
};
|
|
971
1156
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1157
|
+
cancelHostCallback = function () {
|
|
1158
|
+
scheduledHostCallback = null;
|
|
1159
|
+
isMessageEventScheduled = false;
|
|
975
1160
|
timeoutTime = -1;
|
|
976
1161
|
};
|
|
977
1162
|
}
|
|
978
1163
|
|
|
1164
|
+
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
// In some cases, StrictMode should also double-render lifecycles.
|
|
1168
|
+
// This can be confusing for tests though,
|
|
1169
|
+
// And it can be bad for performance in production.
|
|
1170
|
+
// This feature flag can be used to control the behavior:
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
1174
|
+
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
// Trace which interactions trigger each commit.
|
|
1184
|
+
var enableSchedulerTracing = true;
|
|
1185
|
+
|
|
1186
|
+
// Only used in www builds.
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
// Only used in www builds.
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
// React Fire: prevent the value and checked attributes from syncing
|
|
1193
|
+
// with their related DOM properties
|
|
1194
|
+
|
|
979
1195
|
var DEFAULT_THREAD_ID = 0;
|
|
980
1196
|
|
|
981
1197
|
// Counters used to generate unique IDs.
|
|
@@ -1379,10 +1595,13 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
1379
1595
|
var Resolved = 1;
|
|
1380
1596
|
|
|
1381
1597
|
|
|
1598
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
1599
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
1600
|
+
}
|
|
1382
1601
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
return
|
|
1602
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
1603
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
1604
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
|
1386
1605
|
}
|
|
1387
1606
|
|
|
1388
1607
|
function getComponentName(type) {
|
|
@@ -1402,8 +1621,8 @@ function getComponentName(type) {
|
|
|
1402
1621
|
return type;
|
|
1403
1622
|
}
|
|
1404
1623
|
switch (type) {
|
|
1405
|
-
case
|
|
1406
|
-
return '
|
|
1624
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
1625
|
+
return 'ConcurrentMode';
|
|
1407
1626
|
case REACT_FRAGMENT_TYPE:
|
|
1408
1627
|
return 'Fragment';
|
|
1409
1628
|
case REACT_PORTAL_TYPE:
|
|
@@ -1412,8 +1631,8 @@ function getComponentName(type) {
|
|
|
1412
1631
|
return 'Profiler';
|
|
1413
1632
|
case REACT_STRICT_MODE_TYPE:
|
|
1414
1633
|
return 'StrictMode';
|
|
1415
|
-
case
|
|
1416
|
-
return '
|
|
1634
|
+
case REACT_SUSPENSE_TYPE:
|
|
1635
|
+
return 'Suspense';
|
|
1417
1636
|
}
|
|
1418
1637
|
if (typeof type === 'object') {
|
|
1419
1638
|
switch (type.$$typeof) {
|
|
@@ -1422,16 +1641,17 @@ function getComponentName(type) {
|
|
|
1422
1641
|
case REACT_PROVIDER_TYPE:
|
|
1423
1642
|
return 'Context.Provider';
|
|
1424
1643
|
case REACT_FORWARD_REF_TYPE:
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
return type.
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1644
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
1645
|
+
case REACT_MEMO_TYPE:
|
|
1646
|
+
return getComponentName(type.type);
|
|
1647
|
+
case REACT_LAZY_TYPE:
|
|
1648
|
+
{
|
|
1649
|
+
var thenable = type;
|
|
1650
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
1651
|
+
if (resolvedThenable) {
|
|
1652
|
+
return getComponentName(resolvedThenable);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1435
1655
|
}
|
|
1436
1656
|
}
|
|
1437
1657
|
return null;
|
|
@@ -1484,12 +1704,15 @@ var ReactSharedInternals = {
|
|
|
1484
1704
|
// This re-export is only required for UMD bundles;
|
|
1485
1705
|
// CJS bundles use the shared NPM package.
|
|
1486
1706
|
objectAssign(ReactSharedInternals, {
|
|
1487
|
-
|
|
1488
|
-
|
|
1707
|
+
Scheduler: {
|
|
1708
|
+
unstable_cancelCallback: unstable_cancelCallback,
|
|
1489
1709
|
unstable_now: getCurrentTime,
|
|
1490
|
-
|
|
1710
|
+
unstable_scheduleCallback: unstable_scheduleCallback,
|
|
1711
|
+
unstable_runWithPriority: unstable_runWithPriority,
|
|
1712
|
+
unstable_wrapCallback: unstable_wrapCallback,
|
|
1713
|
+
unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel
|
|
1491
1714
|
},
|
|
1492
|
-
|
|
1715
|
+
SchedulerTracing: {
|
|
1493
1716
|
__interactionsRef: interactionsRef,
|
|
1494
1717
|
__subscriberRef: subscriberRef,
|
|
1495
1718
|
unstable_clear: unstable_clear,
|
|
@@ -2172,12 +2395,6 @@ function onlyChild(children) {
|
|
|
2172
2395
|
return children;
|
|
2173
2396
|
}
|
|
2174
2397
|
|
|
2175
|
-
function readContext(context, observedBits) {
|
|
2176
|
-
var dispatcher = ReactCurrentOwner.currentDispatcher;
|
|
2177
|
-
!(dispatcher !== null) ? invariant(false, 'Context.unstable_read(): Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps.') : void 0;
|
|
2178
|
-
return dispatcher.readContext(context, observedBits);
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
2398
|
function createContext(defaultValue, calculateChangedBits) {
|
|
2182
2399
|
if (calculateChangedBits === undefined) {
|
|
2183
2400
|
calculateChangedBits = null;
|
|
@@ -2199,16 +2416,69 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
2199
2416
|
_currentValue2: defaultValue,
|
|
2200
2417
|
// These are circular
|
|
2201
2418
|
Provider: null,
|
|
2202
|
-
Consumer: null
|
|
2203
|
-
unstable_read: null
|
|
2419
|
+
Consumer: null
|
|
2204
2420
|
};
|
|
2205
2421
|
|
|
2206
2422
|
context.Provider = {
|
|
2207
2423
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
2208
2424
|
_context: context
|
|
2209
2425
|
};
|
|
2210
|
-
|
|
2211
|
-
|
|
2426
|
+
|
|
2427
|
+
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
2428
|
+
var hasWarnedAboutUsingConsumerProvider = false;
|
|
2429
|
+
|
|
2430
|
+
{
|
|
2431
|
+
// A separate object, but proxies back to the original context object for
|
|
2432
|
+
// backwards compatibility. It has a different $$typeof, so we can properly
|
|
2433
|
+
// warn for the incorrect usage of Context as a Consumer.
|
|
2434
|
+
var Consumer = {
|
|
2435
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
2436
|
+
_context: context,
|
|
2437
|
+
_calculateChangedBits: context._calculateChangedBits
|
|
2438
|
+
};
|
|
2439
|
+
// $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
2440
|
+
Object.defineProperties(Consumer, {
|
|
2441
|
+
Provider: {
|
|
2442
|
+
get: function () {
|
|
2443
|
+
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
2444
|
+
hasWarnedAboutUsingConsumerProvider = true;
|
|
2445
|
+
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?');
|
|
2446
|
+
}
|
|
2447
|
+
return context.Provider;
|
|
2448
|
+
},
|
|
2449
|
+
set: function (_Provider) {
|
|
2450
|
+
context.Provider = _Provider;
|
|
2451
|
+
}
|
|
2452
|
+
},
|
|
2453
|
+
_currentValue: {
|
|
2454
|
+
get: function () {
|
|
2455
|
+
return context._currentValue;
|
|
2456
|
+
},
|
|
2457
|
+
set: function (_currentValue) {
|
|
2458
|
+
context._currentValue = _currentValue;
|
|
2459
|
+
}
|
|
2460
|
+
},
|
|
2461
|
+
_currentValue2: {
|
|
2462
|
+
get: function () {
|
|
2463
|
+
return context._currentValue2;
|
|
2464
|
+
},
|
|
2465
|
+
set: function (_currentValue2) {
|
|
2466
|
+
context._currentValue2 = _currentValue2;
|
|
2467
|
+
}
|
|
2468
|
+
},
|
|
2469
|
+
Consumer: {
|
|
2470
|
+
get: function () {
|
|
2471
|
+
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
2472
|
+
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
2473
|
+
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?');
|
|
2474
|
+
}
|
|
2475
|
+
return context.Consumer;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
// $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
2480
|
+
context.Consumer = Consumer;
|
|
2481
|
+
}
|
|
2212
2482
|
|
|
2213
2483
|
{
|
|
2214
2484
|
context._currentRenderer = null;
|
|
@@ -2219,20 +2489,12 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
2219
2489
|
}
|
|
2220
2490
|
|
|
2221
2491
|
function lazy(ctor) {
|
|
2222
|
-
var thenable = null;
|
|
2223
2492
|
return {
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
// Lazily create thenable by wrapping in an extra thenable.
|
|
2227
|
-
thenable = ctor();
|
|
2228
|
-
ctor = null;
|
|
2229
|
-
}
|
|
2230
|
-
return thenable.then(resolve, reject);
|
|
2231
|
-
},
|
|
2232
|
-
|
|
2493
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
2494
|
+
_ctor: ctor,
|
|
2233
2495
|
// React uses these fields to store the result.
|
|
2234
|
-
|
|
2235
|
-
|
|
2496
|
+
_status: -1,
|
|
2497
|
+
_result: null
|
|
2236
2498
|
};
|
|
2237
2499
|
}
|
|
2238
2500
|
|
|
@@ -2260,7 +2522,20 @@ function forwardRef(render) {
|
|
|
2260
2522
|
function isValidElementType(type) {
|
|
2261
2523
|
return typeof type === 'string' || typeof type === 'function' ||
|
|
2262
2524
|
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
2263
|
-
type === REACT_FRAGMENT_TYPE || type ===
|
|
2525
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
function memo(type, compare) {
|
|
2529
|
+
{
|
|
2530
|
+
if (!isValidElementType(type)) {
|
|
2531
|
+
warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
return {
|
|
2535
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
2536
|
+
type: type,
|
|
2537
|
+
compare: compare === undefined ? null : compare
|
|
2538
|
+
};
|
|
2264
2539
|
}
|
|
2265
2540
|
|
|
2266
2541
|
/**
|
|
@@ -2513,7 +2788,7 @@ function validatePropTypes(element) {
|
|
|
2513
2788
|
var name = void 0,
|
|
2514
2789
|
propTypes = void 0;
|
|
2515
2790
|
if (typeof type === 'function') {
|
|
2516
|
-
// Class or
|
|
2791
|
+
// Class or function component
|
|
2517
2792
|
name = type.displayName || type.name;
|
|
2518
2793
|
propTypes = type.propTypes;
|
|
2519
2794
|
} else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) {
|
|
@@ -2665,10 +2940,13 @@ var React = {
|
|
|
2665
2940
|
|
|
2666
2941
|
createContext: createContext,
|
|
2667
2942
|
forwardRef: forwardRef,
|
|
2943
|
+
lazy: lazy,
|
|
2944
|
+
memo: memo,
|
|
2668
2945
|
|
|
2669
2946
|
Fragment: REACT_FRAGMENT_TYPE,
|
|
2670
2947
|
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
2671
|
-
|
|
2948
|
+
unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
|
2949
|
+
Suspense: REACT_SUSPENSE_TYPE,
|
|
2672
2950
|
unstable_Profiler: REACT_PROFILER_TYPE,
|
|
2673
2951
|
|
|
2674
2952
|
createElement: createElementWithValidation,
|
|
@@ -2681,11 +2959,6 @@ var React = {
|
|
|
2681
2959
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
2682
2960
|
};
|
|
2683
2961
|
|
|
2684
|
-
if (enableSuspense) {
|
|
2685
|
-
React.Placeholder = REACT_PLACEHOLDER_TYPE;
|
|
2686
|
-
React.lazy = lazy;
|
|
2687
|
-
}
|
|
2688
|
-
|
|
2689
2962
|
|
|
2690
2963
|
|
|
2691
2964
|
var React$2 = Object.freeze({
|