react 16.13.1 → 17.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/react-jsx-dev-runtime.development.js +1203 -0
- package/cjs/react-jsx-dev-runtime.production.min.js +9 -0
- package/cjs/react-jsx-dev-runtime.profiling.min.js +9 -0
- package/cjs/react-jsx-runtime.development.js +1221 -0
- package/cjs/react-jsx-runtime.production.min.js +10 -0
- package/cjs/react-jsx-runtime.profiling.min.js +10 -0
- package/cjs/react.development.js +813 -392
- package/cjs/react.production.min.js +16 -18
- package/jsx-dev-runtime.js +7 -0
- package/jsx-runtime.js +7 -0
- package/package.json +5 -4
- package/umd/react.development.js +865 -628
- package/umd/react.production.min.js +24 -25
- package/umd/react.profiling.min.js +31 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v17.0.0-rc.2
|
|
2
2
|
* react.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,20 +6,18 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
|
|
24
|
-
exports.lazy=function(a){return{$$typeof:A,_ctor:a,_status:-1,_result:null}};exports.memo=function(a,b){return{$$typeof:z,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return Z().useCallback(a,b)};exports.useContext=function(a,b){return Z().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return Z().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return Z().useImperativeHandle(a,b,c)};
|
|
25
|
-
exports.useLayoutEffect=function(a,b){return Z().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return Z().useMemo(a,b)};exports.useReducer=function(a,b,c){return Z().useReducer(a,b,c)};exports.useRef=function(a){return Z().useRef(a)};exports.useState=function(a){return Z().useState(a)};exports.version="16.13.1";
|
|
9
|
+
'use strict';var l=require("object-assign"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;
|
|
10
|
+
if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy")}var x="function"===typeof Symbol&&Symbol.iterator;
|
|
11
|
+
function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return"function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
12
|
+
var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState")};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};
|
|
13
|
+
function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
|
|
14
|
+
function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return{$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
|
|
15
|
+
function K(a,b){return{$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return"object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
16
|
+
function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
|
|
17
|
+
0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d)}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
|
|
18
|
+
function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};
|
|
19
|
+
exports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments)},c)},count:function(a){var b=0;P(a,function(){b++});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};exports.Component=C;exports.PureComponent=E;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
|
|
20
|
+
exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g}return{$$typeof:n,type:a.type,
|
|
21
|
+
key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=J;exports.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:t,render:a}};exports.isValidElement=L;
|
|
22
|
+
exports.lazy=function(a){return{$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};exports.memo=function(a,b){return{$$typeof:u,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return S().useCallback(a,b)};exports.useContext=function(a,b){return S().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
|
|
23
|
+
exports.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S().useMemo(a,b)};exports.useReducer=function(a,b,c){return S().useReducer(a,b,c)};exports.useRef=function(a){return S().useRef(a)};exports.useState=function(a){return S().useState(a)};exports.version="17.0.0-rc.2";
|
package/jsx-runtime.js
ADDED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react"
|
|
6
6
|
],
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "17.0.0-rc.2",
|
|
8
8
|
"homepage": "https://reactjs.org/",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "MIT",
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"build-info.json",
|
|
15
15
|
"index.js",
|
|
16
16
|
"cjs/",
|
|
17
|
-
"umd/"
|
|
17
|
+
"umd/",
|
|
18
|
+
"jsx-runtime.js",
|
|
19
|
+
"jsx-dev-runtime.js"
|
|
18
20
|
],
|
|
19
21
|
"main": "index.js",
|
|
20
22
|
"repository": {
|
|
@@ -27,8 +29,7 @@
|
|
|
27
29
|
},
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"loose-envify": "^1.1.0",
|
|
30
|
-
"object-assign": "^4.1.1"
|
|
31
|
-
"prop-types": "^15.6.2"
|
|
32
|
+
"object-assign": "^4.1.1"
|
|
32
33
|
},
|
|
33
34
|
"browserify": {
|
|
34
35
|
"transform": [
|
package/umd/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v17.0.0-rc.2
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,37 +6,65 @@
|
|
|
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
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
9
|
(function (global, factory) {
|
|
13
10
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
14
11
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
15
12
|
(global = global || self, factory(global.React = {}));
|
|
16
13
|
}(this, (function (exports) { 'use strict';
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
// TODO: this is special because it gets imported during build.
|
|
16
|
+
var ReactVersion = '17.0.0-rc.2';
|
|
19
17
|
|
|
18
|
+
// ATTENTION
|
|
19
|
+
// When adding new symbols to this file,
|
|
20
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
20
21
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
21
22
|
// nor polyfill, then a plain number is used for performance.
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
23
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
24
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
25
|
+
exports.Fragment = 0xeacb;
|
|
26
|
+
exports.StrictMode = 0xeacc;
|
|
27
|
+
exports.Profiler = 0xead2;
|
|
28
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
29
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
30
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
31
|
+
exports.Suspense = 0xead1;
|
|
32
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
33
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
34
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
35
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
36
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
37
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
38
|
+
var REACT_SCOPE_TYPE = 0xead7;
|
|
39
|
+
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
40
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
41
|
+
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
42
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
43
|
+
|
|
44
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
45
|
+
var symbolFor = Symbol.for;
|
|
46
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
47
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
48
|
+
exports.Fragment = symbolFor('react.fragment');
|
|
49
|
+
exports.StrictMode = symbolFor('react.strict_mode');
|
|
50
|
+
exports.Profiler = symbolFor('react.profiler');
|
|
51
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
52
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
53
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
54
|
+
exports.Suspense = symbolFor('react.suspense');
|
|
55
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
56
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
57
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
58
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
59
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
60
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
61
|
+
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
62
|
+
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
63
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
64
|
+
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
65
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
66
|
+
}
|
|
67
|
+
|
|
40
68
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
41
69
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
42
70
|
function getIteratorFn(maybeIterable) {
|
|
@@ -53,93 +81,32 @@
|
|
|
53
81
|
return null;
|
|
54
82
|
}
|
|
55
83
|
|
|
56
|
-
/*
|
|
57
|
-
object-assign
|
|
58
|
-
(c) Sindre Sorhus
|
|
59
|
-
@license MIT
|
|
60
|
-
*/
|
|
61
|
-
/* eslint-disable no-unused-vars */
|
|
62
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
63
84
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
90
|
-
var test2 = {};
|
|
91
|
-
for (var i = 0; i < 10; i++) {
|
|
92
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
93
|
-
}
|
|
94
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
95
|
-
return test2[n];
|
|
96
|
-
});
|
|
97
|
-
if (order2.join('') !== '0123456789') {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
102
|
-
var test3 = {};
|
|
103
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
104
|
-
test3[letter] = letter;
|
|
105
|
-
});
|
|
106
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
107
|
-
'abcdefghijklmnopqrst') {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return true;
|
|
112
|
-
} catch (err) {
|
|
113
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
119
|
-
var from;
|
|
120
|
-
var to = toObject(target);
|
|
121
|
-
var symbols;
|
|
122
|
-
|
|
123
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
124
|
-
from = Object(arguments[s]);
|
|
125
|
-
|
|
126
|
-
for (var key in from) {
|
|
127
|
-
if (hasOwnProperty.call(from, key)) {
|
|
128
|
-
to[key] = from[key];
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (getOwnPropertySymbols) {
|
|
133
|
-
symbols = getOwnPropertySymbols(from);
|
|
134
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
135
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
136
|
-
to[symbols[i]] = from[symbols[i]];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return to;
|
|
85
|
+
|
|
86
|
+
var _assign = function (to, from) {
|
|
87
|
+
for (var key in from) {
|
|
88
|
+
if (hasOwnProperty.call(from, key)) {
|
|
89
|
+
to[key] = from[key];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var assign = Object.assign || function (target, sources) {
|
|
95
|
+
if (target == null) {
|
|
96
|
+
throw new TypeError('Object.assign target cannot be null or undefined');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var to = Object(target);
|
|
100
|
+
|
|
101
|
+
for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
|
102
|
+
var nextSource = arguments[nextIndex];
|
|
103
|
+
|
|
104
|
+
if (nextSource != null) {
|
|
105
|
+
_assign(to, Object(nextSource));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return to;
|
|
143
110
|
};
|
|
144
111
|
|
|
145
112
|
/**
|
|
@@ -158,7 +125,7 @@
|
|
|
158
125
|
* should suspend for if it needs to.
|
|
159
126
|
*/
|
|
160
127
|
var ReactCurrentBatchConfig = {
|
|
161
|
-
|
|
128
|
+
transition: 0
|
|
162
129
|
};
|
|
163
130
|
|
|
164
131
|
/**
|
|
@@ -175,142 +142,29 @@
|
|
|
175
142
|
current: null
|
|
176
143
|
};
|
|
177
144
|
|
|
178
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
179
|
-
function describeComponentFrame (name, source, ownerName) {
|
|
180
|
-
var sourceInfo = '';
|
|
181
|
-
|
|
182
|
-
if (source) {
|
|
183
|
-
var path = source.fileName;
|
|
184
|
-
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
185
|
-
|
|
186
|
-
{
|
|
187
|
-
// In DEV, include code for a common special case:
|
|
188
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
189
|
-
if (/^index\./.test(fileName)) {
|
|
190
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
191
|
-
|
|
192
|
-
if (match) {
|
|
193
|
-
var pathBeforeSlash = match[1];
|
|
194
|
-
|
|
195
|
-
if (pathBeforeSlash) {
|
|
196
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
197
|
-
fileName = folderName + '/' + fileName;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
204
|
-
} else if (ownerName) {
|
|
205
|
-
sourceInfo = ' (created by ' + ownerName + ')';
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
var Resolved = 1;
|
|
212
|
-
function refineResolvedLazyComponent(lazyComponent) {
|
|
213
|
-
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
217
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
218
|
-
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function getComponentName(type) {
|
|
222
|
-
if (type == null) {
|
|
223
|
-
// Host root, text node or just invalid type.
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
{
|
|
228
|
-
if (typeof type.tag === 'number') {
|
|
229
|
-
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (typeof type === 'function') {
|
|
234
|
-
return type.displayName || type.name || null;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (typeof type === 'string') {
|
|
238
|
-
return type;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
switch (type) {
|
|
242
|
-
case REACT_FRAGMENT_TYPE:
|
|
243
|
-
return 'Fragment';
|
|
244
|
-
|
|
245
|
-
case REACT_PORTAL_TYPE:
|
|
246
|
-
return 'Portal';
|
|
247
|
-
|
|
248
|
-
case REACT_PROFILER_TYPE:
|
|
249
|
-
return "Profiler";
|
|
250
|
-
|
|
251
|
-
case REACT_STRICT_MODE_TYPE:
|
|
252
|
-
return 'StrictMode';
|
|
253
|
-
|
|
254
|
-
case REACT_SUSPENSE_TYPE:
|
|
255
|
-
return 'Suspense';
|
|
256
|
-
|
|
257
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
258
|
-
return 'SuspenseList';
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (typeof type === 'object') {
|
|
262
|
-
switch (type.$$typeof) {
|
|
263
|
-
case REACT_CONTEXT_TYPE:
|
|
264
|
-
return 'Context.Consumer';
|
|
265
|
-
|
|
266
|
-
case REACT_PROVIDER_TYPE:
|
|
267
|
-
return 'Context.Provider';
|
|
268
|
-
|
|
269
|
-
case REACT_FORWARD_REF_TYPE:
|
|
270
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
|
271
|
-
|
|
272
|
-
case REACT_MEMO_TYPE:
|
|
273
|
-
return getComponentName(type.type);
|
|
274
|
-
|
|
275
|
-
case REACT_BLOCK_TYPE:
|
|
276
|
-
return getComponentName(type.render);
|
|
277
|
-
|
|
278
|
-
case REACT_LAZY_TYPE:
|
|
279
|
-
{
|
|
280
|
-
var thenable = type;
|
|
281
|
-
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
282
|
-
|
|
283
|
-
if (resolvedThenable) {
|
|
284
|
-
return getComponentName(resolvedThenable);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
145
|
var ReactDebugCurrentFrame = {};
|
|
296
|
-
var
|
|
297
|
-
function
|
|
146
|
+
var currentExtraStackFrame = null;
|
|
147
|
+
function setExtraStackFrame(stack) {
|
|
298
148
|
{
|
|
299
|
-
|
|
149
|
+
currentExtraStackFrame = stack;
|
|
300
150
|
}
|
|
301
151
|
}
|
|
302
152
|
|
|
303
153
|
{
|
|
304
|
-
|
|
154
|
+
ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
|
155
|
+
{
|
|
156
|
+
currentExtraStackFrame = stack;
|
|
157
|
+
}
|
|
158
|
+
}; // Stack implementation injected by the current renderer.
|
|
159
|
+
|
|
160
|
+
|
|
305
161
|
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
306
162
|
|
|
307
163
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
308
164
|
var stack = ''; // Add an extra top frame while an element is being validated
|
|
309
165
|
|
|
310
|
-
if (
|
|
311
|
-
|
|
312
|
-
var owner = currentlyValidatingElement._owner;
|
|
313
|
-
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
166
|
+
if (currentExtraStackFrame) {
|
|
167
|
+
stack += currentExtraStackFrame;
|
|
314
168
|
} // Delegate to the injected renderer-specific implementation
|
|
315
169
|
|
|
316
170
|
|
|
@@ -337,17 +191,11 @@
|
|
|
337
191
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
338
192
|
IsSomeRendererActing: IsSomeRendererActing,
|
|
339
193
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
340
|
-
assign:
|
|
194
|
+
assign: assign
|
|
341
195
|
};
|
|
342
196
|
|
|
343
197
|
{
|
|
344
|
-
|
|
345
|
-
// These should not be included in production.
|
|
346
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
347
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
348
|
-
// TODO: remove in React 17.0.
|
|
349
|
-
ReactComponentTreeHook: {}
|
|
350
|
-
});
|
|
198
|
+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
351
199
|
}
|
|
352
200
|
|
|
353
201
|
// by calls to these methods by a Babel plugin.
|
|
@@ -378,16 +226,12 @@
|
|
|
378
226
|
// When changing this logic, you might want to also
|
|
379
227
|
// update consoleWithStackDev.www.js as well.
|
|
380
228
|
{
|
|
381
|
-
var
|
|
382
|
-
|
|
383
|
-
if (!hasExistingStack) {
|
|
384
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
385
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
229
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
230
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
386
231
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
232
|
+
if (stack !== '') {
|
|
233
|
+
format += '%s';
|
|
234
|
+
args = args.concat([stack]);
|
|
391
235
|
}
|
|
392
236
|
|
|
393
237
|
var argsWithFormat = args.map(function (item) {
|
|
@@ -399,17 +243,6 @@
|
|
|
399
243
|
// eslint-disable-next-line react-internal/no-production-logging
|
|
400
244
|
|
|
401
245
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
402
|
-
|
|
403
|
-
try {
|
|
404
|
-
// --- Welcome to debugging React ---
|
|
405
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
406
|
-
// to find the callsite that caused this warning to fire.
|
|
407
|
-
var argIndex = 0;
|
|
408
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
409
|
-
return args[argIndex++];
|
|
410
|
-
});
|
|
411
|
-
throw new Error(message);
|
|
412
|
-
} catch (x) {}
|
|
413
246
|
}
|
|
414
247
|
}
|
|
415
248
|
|
|
@@ -623,7 +456,7 @@
|
|
|
623
456
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
624
457
|
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
625
458
|
|
|
626
|
-
|
|
459
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
627
460
|
|
|
628
461
|
pureComponentPrototype.isPureReactComponent = true;
|
|
629
462
|
|
|
@@ -640,6 +473,92 @@
|
|
|
640
473
|
return refObject;
|
|
641
474
|
}
|
|
642
475
|
|
|
476
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
477
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
478
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function getContextName(type) {
|
|
482
|
+
return type.displayName || 'Context';
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function getComponentName(type) {
|
|
486
|
+
if (type == null) {
|
|
487
|
+
// Host root, text node or just invalid type.
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
{
|
|
492
|
+
if (typeof type.tag === 'number') {
|
|
493
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (typeof type === 'function') {
|
|
498
|
+
return type.displayName || type.name || null;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
if (typeof type === 'string') {
|
|
502
|
+
return type;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
switch (type) {
|
|
506
|
+
case exports.Fragment:
|
|
507
|
+
return 'Fragment';
|
|
508
|
+
|
|
509
|
+
case REACT_PORTAL_TYPE:
|
|
510
|
+
return 'Portal';
|
|
511
|
+
|
|
512
|
+
case exports.Profiler:
|
|
513
|
+
return 'Profiler';
|
|
514
|
+
|
|
515
|
+
case exports.StrictMode:
|
|
516
|
+
return 'StrictMode';
|
|
517
|
+
|
|
518
|
+
case exports.Suspense:
|
|
519
|
+
return 'Suspense';
|
|
520
|
+
|
|
521
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
522
|
+
return 'SuspenseList';
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (typeof type === 'object') {
|
|
526
|
+
switch (type.$$typeof) {
|
|
527
|
+
case REACT_CONTEXT_TYPE:
|
|
528
|
+
var context = type;
|
|
529
|
+
return getContextName(context) + '.Consumer';
|
|
530
|
+
|
|
531
|
+
case REACT_PROVIDER_TYPE:
|
|
532
|
+
var provider = type;
|
|
533
|
+
return getContextName(provider._context) + '.Provider';
|
|
534
|
+
|
|
535
|
+
case REACT_FORWARD_REF_TYPE:
|
|
536
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
537
|
+
|
|
538
|
+
case REACT_MEMO_TYPE:
|
|
539
|
+
return getComponentName(type.type);
|
|
540
|
+
|
|
541
|
+
case REACT_BLOCK_TYPE:
|
|
542
|
+
return getComponentName(type._render);
|
|
543
|
+
|
|
544
|
+
case REACT_LAZY_TYPE:
|
|
545
|
+
{
|
|
546
|
+
var lazyComponent = type;
|
|
547
|
+
var payload = lazyComponent._payload;
|
|
548
|
+
var init = lazyComponent._init;
|
|
549
|
+
|
|
550
|
+
try {
|
|
551
|
+
return getComponentName(init(payload));
|
|
552
|
+
} catch (x) {
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
|
|
643
562
|
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
644
563
|
var RESERVED_PROPS = {
|
|
645
564
|
key: true,
|
|
@@ -687,7 +606,7 @@
|
|
|
687
606
|
if (!specialPropKeyWarningShown) {
|
|
688
607
|
specialPropKeyWarningShown = true;
|
|
689
608
|
|
|
690
|
-
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://
|
|
609
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
691
610
|
}
|
|
692
611
|
}
|
|
693
612
|
};
|
|
@@ -705,7 +624,7 @@
|
|
|
705
624
|
if (!specialPropRefWarningShown) {
|
|
706
625
|
specialPropRefWarningShown = true;
|
|
707
626
|
|
|
708
|
-
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://
|
|
627
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
709
628
|
}
|
|
710
629
|
}
|
|
711
630
|
};
|
|
@@ -723,7 +642,7 @@
|
|
|
723
642
|
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
724
643
|
|
|
725
644
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
726
|
-
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://
|
|
645
|
+
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);
|
|
727
646
|
|
|
728
647
|
didWarnAboutStringRefs[componentName] = true;
|
|
729
648
|
}
|
|
@@ -909,7 +828,7 @@
|
|
|
909
828
|
|
|
910
829
|
var propName; // Original props are copied
|
|
911
830
|
|
|
912
|
-
var props =
|
|
831
|
+
var props = assign({}, element.props); // Reserved names are extracted
|
|
913
832
|
|
|
914
833
|
|
|
915
834
|
var key = element.key;
|
|
@@ -998,7 +917,7 @@
|
|
|
998
917
|
'=': '=0',
|
|
999
918
|
':': '=2'
|
|
1000
919
|
};
|
|
1001
|
-
var escapedString =
|
|
920
|
+
var escapedString = key.replace(escapeRegex, function (match) {
|
|
1002
921
|
return escaperLookup[match];
|
|
1003
922
|
});
|
|
1004
923
|
return '$' + escapedString;
|
|
@@ -1013,54 +932,30 @@
|
|
|
1013
932
|
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
1014
933
|
|
|
1015
934
|
function escapeUserProvidedKey(text) {
|
|
1016
|
-
return
|
|
935
|
+
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
|
1017
936
|
}
|
|
937
|
+
/**
|
|
938
|
+
* Generate a key string that identifies a element within a set.
|
|
939
|
+
*
|
|
940
|
+
* @param {*} element A element that could contain a manual key.
|
|
941
|
+
* @param {number} index Index that is used if a manual key is not provided.
|
|
942
|
+
* @return {string}
|
|
943
|
+
*/
|
|
1018
944
|
|
|
1019
|
-
var POOL_SIZE = 10;
|
|
1020
|
-
var traverseContextPool = [];
|
|
1021
945
|
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
traverseContext.count = 0;
|
|
1030
|
-
return traverseContext;
|
|
1031
|
-
} else {
|
|
1032
|
-
return {
|
|
1033
|
-
result: mapResult,
|
|
1034
|
-
keyPrefix: keyPrefix,
|
|
1035
|
-
func: mapFunction,
|
|
1036
|
-
context: mapContext,
|
|
1037
|
-
count: 0
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
946
|
+
function getElementKey(element, index) {
|
|
947
|
+
// Do some typechecking here since we call this blindly. We want to ensure
|
|
948
|
+
// that we don't block potential future ES APIs.
|
|
949
|
+
if (typeof element === 'object' && element !== null && element.key != null) {
|
|
950
|
+
// Explicit key
|
|
951
|
+
return escape('' + element.key);
|
|
952
|
+
} // Implicit key determined by the index in the set
|
|
1041
953
|
|
|
1042
|
-
function releaseTraverseContext(traverseContext) {
|
|
1043
|
-
traverseContext.result = null;
|
|
1044
|
-
traverseContext.keyPrefix = null;
|
|
1045
|
-
traverseContext.func = null;
|
|
1046
|
-
traverseContext.context = null;
|
|
1047
|
-
traverseContext.count = 0;
|
|
1048
954
|
|
|
1049
|
-
|
|
1050
|
-
traverseContextPool.push(traverseContext);
|
|
1051
|
-
}
|
|
955
|
+
return index.toString(36);
|
|
1052
956
|
}
|
|
1053
|
-
/**
|
|
1054
|
-
* @param {?*} children Children tree container.
|
|
1055
|
-
* @param {!string} nameSoFar Name of the key path so far.
|
|
1056
|
-
* @param {!function} callback Callback to invoke with each child found.
|
|
1057
|
-
* @param {?*} traverseContext Used to pass information throughout the traversal
|
|
1058
|
-
* process.
|
|
1059
|
-
* @return {!number} The number of children in this subtree.
|
|
1060
|
-
*/
|
|
1061
|
-
|
|
1062
957
|
|
|
1063
|
-
function
|
|
958
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
1064
959
|
var type = typeof children;
|
|
1065
960
|
|
|
1066
961
|
if (type === 'undefined' || type === 'boolean') {
|
|
@@ -1090,9 +985,34 @@
|
|
|
1090
985
|
}
|
|
1091
986
|
|
|
1092
987
|
if (invokeCallback) {
|
|
1093
|
-
|
|
1094
|
-
//
|
|
1095
|
-
|
|
988
|
+
var _child = children;
|
|
989
|
+
var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
|
|
990
|
+
// so that it's consistent if the number of children grows:
|
|
991
|
+
|
|
992
|
+
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
993
|
+
|
|
994
|
+
if (Array.isArray(mappedChild)) {
|
|
995
|
+
var escapedChildKey = '';
|
|
996
|
+
|
|
997
|
+
if (childKey != null) {
|
|
998
|
+
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
|
|
1002
|
+
return c;
|
|
1003
|
+
});
|
|
1004
|
+
} else if (mappedChild != null) {
|
|
1005
|
+
if (isValidElement(mappedChild)) {
|
|
1006
|
+
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1007
|
+
// traverseAllChildren used to do for objects as children
|
|
1008
|
+
escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1009
|
+
mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
1010
|
+
escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
array.push(mappedChild);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1096
1016
|
return 1;
|
|
1097
1017
|
}
|
|
1098
1018
|
|
|
@@ -1105,46 +1025,41 @@
|
|
|
1105
1025
|
if (Array.isArray(children)) {
|
|
1106
1026
|
for (var i = 0; i < children.length; i++) {
|
|
1107
1027
|
child = children[i];
|
|
1108
|
-
nextName = nextNamePrefix +
|
|
1109
|
-
subtreeCount +=
|
|
1028
|
+
nextName = nextNamePrefix + getElementKey(child, i);
|
|
1029
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1110
1030
|
}
|
|
1111
1031
|
} else {
|
|
1112
1032
|
var iteratorFn = getIteratorFn(children);
|
|
1113
1033
|
|
|
1114
1034
|
if (typeof iteratorFn === 'function') {
|
|
1035
|
+
var iterableChildren = children;
|
|
1115
1036
|
|
|
1116
1037
|
{
|
|
1117
1038
|
// Warn about using Maps as children
|
|
1118
|
-
if (iteratorFn ===
|
|
1039
|
+
if (iteratorFn === iterableChildren.entries) {
|
|
1119
1040
|
if (!didWarnAboutMaps) {
|
|
1120
|
-
warn('Using Maps as children is
|
|
1041
|
+
warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
|
1121
1042
|
}
|
|
1122
1043
|
|
|
1123
1044
|
didWarnAboutMaps = true;
|
|
1124
1045
|
}
|
|
1125
1046
|
}
|
|
1126
1047
|
|
|
1127
|
-
var iterator = iteratorFn.call(
|
|
1048
|
+
var iterator = iteratorFn.call(iterableChildren);
|
|
1128
1049
|
var step;
|
|
1129
1050
|
var ii = 0;
|
|
1130
1051
|
|
|
1131
1052
|
while (!(step = iterator.next()).done) {
|
|
1132
1053
|
child = step.value;
|
|
1133
|
-
nextName = nextNamePrefix +
|
|
1134
|
-
subtreeCount +=
|
|
1054
|
+
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1055
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1135
1056
|
}
|
|
1136
1057
|
} else if (type === 'object') {
|
|
1137
|
-
var addendum = '';
|
|
1138
|
-
|
|
1139
|
-
{
|
|
1140
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
1058
|
var childrenString = '' + children;
|
|
1144
1059
|
|
|
1145
1060
|
{
|
|
1146
1061
|
{
|
|
1147
|
-
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ").
|
|
1062
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
|
|
1148
1063
|
}
|
|
1149
1064
|
}
|
|
1150
1065
|
}
|
|
@@ -1152,120 +1067,13 @@
|
|
|
1152
1067
|
|
|
1153
1068
|
return subtreeCount;
|
|
1154
1069
|
}
|
|
1155
|
-
/**
|
|
1156
|
-
* Traverses children that are typically specified as `props.children`, but
|
|
1157
|
-
* might also be specified through attributes:
|
|
1158
|
-
*
|
|
1159
|
-
* - `traverseAllChildren(this.props.children, ...)`
|
|
1160
|
-
* - `traverseAllChildren(this.props.leftPanelChildren, ...)`
|
|
1161
|
-
*
|
|
1162
|
-
* The `traverseContext` is an optional argument that is passed through the
|
|
1163
|
-
* entire traversal. It can be used to store accumulations or anything else that
|
|
1164
|
-
* the callback might find relevant.
|
|
1165
|
-
*
|
|
1166
|
-
* @param {?*} children Children tree object.
|
|
1167
|
-
* @param {!function} callback To invoke upon traversing each child.
|
|
1168
|
-
* @param {?*} traverseContext Context for traversal.
|
|
1169
|
-
* @return {!number} The number of children in this subtree.
|
|
1170
|
-
*/
|
|
1171
|
-
|
|
1172
1070
|
|
|
1173
|
-
function traverseAllChildren(children, callback, traverseContext) {
|
|
1174
|
-
if (children == null) {
|
|
1175
|
-
return 0;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
|
1179
|
-
}
|
|
1180
|
-
/**
|
|
1181
|
-
* Generate a key string that identifies a component within a set.
|
|
1182
|
-
*
|
|
1183
|
-
* @param {*} component A component that could contain a manual key.
|
|
1184
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
|
1185
|
-
* @return {string}
|
|
1186
|
-
*/
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
function getComponentKey(component, index) {
|
|
1190
|
-
// Do some typechecking here since we call this blindly. We want to ensure
|
|
1191
|
-
// that we don't block potential future ES APIs.
|
|
1192
|
-
if (typeof component === 'object' && component !== null && component.key != null) {
|
|
1193
|
-
// Explicit key
|
|
1194
|
-
return escape(component.key);
|
|
1195
|
-
} // Implicit key determined by the index in the set
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
return index.toString(36);
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
function forEachSingleChild(bookKeeping, child, name) {
|
|
1202
|
-
var func = bookKeeping.func,
|
|
1203
|
-
context = bookKeeping.context;
|
|
1204
|
-
func.call(context, child, bookKeeping.count++);
|
|
1205
|
-
}
|
|
1206
|
-
/**
|
|
1207
|
-
* Iterates through children that are typically specified as `props.children`.
|
|
1208
|
-
*
|
|
1209
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
1210
|
-
*
|
|
1211
|
-
* The provided forEachFunc(child, index) will be called for each
|
|
1212
|
-
* leaf child.
|
|
1213
|
-
*
|
|
1214
|
-
* @param {?*} children Children tree container.
|
|
1215
|
-
* @param {function(*, int)} forEachFunc
|
|
1216
|
-
* @param {*} forEachContext Context for forEachContext.
|
|
1217
|
-
*/
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1221
|
-
if (children == null) {
|
|
1222
|
-
return children;
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
|
1226
|
-
traverseAllChildren(children, forEachSingleChild, traverseContext);
|
|
1227
|
-
releaseTraverseContext(traverseContext);
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
|
1231
|
-
var result = bookKeeping.result,
|
|
1232
|
-
keyPrefix = bookKeeping.keyPrefix,
|
|
1233
|
-
func = bookKeeping.func,
|
|
1234
|
-
context = bookKeeping.context;
|
|
1235
|
-
var mappedChild = func.call(context, child, bookKeeping.count++);
|
|
1236
|
-
|
|
1237
|
-
if (Array.isArray(mappedChild)) {
|
|
1238
|
-
mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
|
1239
|
-
return c;
|
|
1240
|
-
});
|
|
1241
|
-
} else if (mappedChild != null) {
|
|
1242
|
-
if (isValidElement(mappedChild)) {
|
|
1243
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1244
|
-
// traverseAllChildren used to do for objects as children
|
|
1245
|
-
keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
result.push(mappedChild);
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
|
1253
|
-
var escapedPrefix = '';
|
|
1254
|
-
|
|
1255
|
-
if (prefix != null) {
|
|
1256
|
-
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
|
1260
|
-
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
|
1261
|
-
releaseTraverseContext(traverseContext);
|
|
1262
|
-
}
|
|
1263
1071
|
/**
|
|
1264
1072
|
* Maps children that are typically specified as `props.children`.
|
|
1265
1073
|
*
|
|
1266
1074
|
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1267
1075
|
*
|
|
1268
|
-
* The provided mapFunction(child,
|
|
1076
|
+
* The provided mapFunction(child, index) will be called for each
|
|
1269
1077
|
* leaf child.
|
|
1270
1078
|
*
|
|
1271
1079
|
* @param {?*} children Children tree container.
|
|
@@ -1273,15 +1081,16 @@
|
|
|
1273
1081
|
* @param {*} context Context for mapFunction.
|
|
1274
1082
|
* @return {object} Object containing the ordered map of results.
|
|
1275
1083
|
*/
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
1084
|
function mapChildren(children, func, context) {
|
|
1279
1085
|
if (children == null) {
|
|
1280
1086
|
return children;
|
|
1281
1087
|
}
|
|
1282
1088
|
|
|
1283
1089
|
var result = [];
|
|
1284
|
-
|
|
1090
|
+
var count = 0;
|
|
1091
|
+
mapIntoArray(children, result, '', '', function (child) {
|
|
1092
|
+
return func.call(context, child, count++);
|
|
1093
|
+
});
|
|
1285
1094
|
return result;
|
|
1286
1095
|
}
|
|
1287
1096
|
/**
|
|
@@ -1296,9 +1105,29 @@
|
|
|
1296
1105
|
|
|
1297
1106
|
|
|
1298
1107
|
function countChildren(children) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1108
|
+
var n = 0;
|
|
1109
|
+
mapChildren(children, function () {
|
|
1110
|
+
n++; // Don't return anything
|
|
1111
|
+
});
|
|
1112
|
+
return n;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* Iterates through children that are typically specified as `props.children`.
|
|
1117
|
+
*
|
|
1118
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
1119
|
+
*
|
|
1120
|
+
* The provided forEachFunc(child, index) will be called for each
|
|
1121
|
+
* leaf child.
|
|
1122
|
+
*
|
|
1123
|
+
* @param {?*} children Children tree container.
|
|
1124
|
+
* @param {function(*, int)} forEachFunc
|
|
1125
|
+
* @param {*} forEachContext Context for forEachContext.
|
|
1126
|
+
*/
|
|
1127
|
+
function forEachChildren(children, forEachFunc, forEachContext) {
|
|
1128
|
+
mapChildren(children, function () {
|
|
1129
|
+
forEachFunc.apply(this, arguments); // Don't return anything.
|
|
1130
|
+
}, forEachContext);
|
|
1302
1131
|
}
|
|
1303
1132
|
/**
|
|
1304
1133
|
* Flatten a children object (typically specified as `props.children`) and
|
|
@@ -1309,11 +1138,9 @@
|
|
|
1309
1138
|
|
|
1310
1139
|
|
|
1311
1140
|
function toArray(children) {
|
|
1312
|
-
|
|
1313
|
-
mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
|
1141
|
+
return mapChildren(children, function (child) {
|
|
1314
1142
|
return child;
|
|
1315
|
-
});
|
|
1316
|
-
return result;
|
|
1143
|
+
}) || [];
|
|
1317
1144
|
}
|
|
1318
1145
|
/**
|
|
1319
1146
|
* Returns the first child in a collection of children and verifies that there
|
|
@@ -1375,6 +1202,7 @@
|
|
|
1375
1202
|
};
|
|
1376
1203
|
var hasWarnedAboutUsingNestedContextConsumers = false;
|
|
1377
1204
|
var hasWarnedAboutUsingConsumerProvider = false;
|
|
1205
|
+
var hasWarnedAboutDisplayNameOnConsumer = false;
|
|
1378
1206
|
|
|
1379
1207
|
{
|
|
1380
1208
|
// A separate object, but proxies back to the original context object for
|
|
@@ -1435,6 +1263,18 @@
|
|
|
1435
1263
|
|
|
1436
1264
|
return context.Consumer;
|
|
1437
1265
|
}
|
|
1266
|
+
},
|
|
1267
|
+
displayName: {
|
|
1268
|
+
get: function () {
|
|
1269
|
+
return context.displayName;
|
|
1270
|
+
},
|
|
1271
|
+
set: function (displayName) {
|
|
1272
|
+
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
1273
|
+
warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
1274
|
+
|
|
1275
|
+
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1438
1278
|
}
|
|
1439
1279
|
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1440
1280
|
|
|
@@ -1449,19 +1289,69 @@
|
|
|
1449
1289
|
return context;
|
|
1450
1290
|
}
|
|
1451
1291
|
|
|
1292
|
+
var Uninitialized = -1;
|
|
1293
|
+
var Pending = 0;
|
|
1294
|
+
var Resolved = 1;
|
|
1295
|
+
var Rejected = 2;
|
|
1296
|
+
|
|
1297
|
+
function lazyInitializer(payload) {
|
|
1298
|
+
if (payload._status === Uninitialized) {
|
|
1299
|
+
var ctor = payload._result;
|
|
1300
|
+
var thenable = ctor(); // Transition to the next state.
|
|
1301
|
+
|
|
1302
|
+
var pending = payload;
|
|
1303
|
+
pending._status = Pending;
|
|
1304
|
+
pending._result = thenable;
|
|
1305
|
+
thenable.then(function (moduleObject) {
|
|
1306
|
+
if (payload._status === Pending) {
|
|
1307
|
+
var defaultExport = moduleObject.default;
|
|
1308
|
+
|
|
1309
|
+
{
|
|
1310
|
+
if (defaultExport === undefined) {
|
|
1311
|
+
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.
|
|
1312
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1313
|
+
}
|
|
1314
|
+
} // Transition to the next state.
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
var resolved = payload;
|
|
1318
|
+
resolved._status = Resolved;
|
|
1319
|
+
resolved._result = defaultExport;
|
|
1320
|
+
}
|
|
1321
|
+
}, function (error) {
|
|
1322
|
+
if (payload._status === Pending) {
|
|
1323
|
+
// Transition to the next state.
|
|
1324
|
+
var rejected = payload;
|
|
1325
|
+
rejected._status = Rejected;
|
|
1326
|
+
rejected._result = error;
|
|
1327
|
+
}
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
if (payload._status === Resolved) {
|
|
1332
|
+
return payload._result;
|
|
1333
|
+
} else {
|
|
1334
|
+
throw payload._result;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1452
1338
|
function lazy(ctor) {
|
|
1339
|
+
var payload = {
|
|
1340
|
+
// We use these fields to store the result.
|
|
1341
|
+
_status: -1,
|
|
1342
|
+
_result: ctor
|
|
1343
|
+
};
|
|
1453
1344
|
var lazyType = {
|
|
1454
1345
|
$$typeof: REACT_LAZY_TYPE,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
_status: -1,
|
|
1458
|
-
_result: null
|
|
1346
|
+
_payload: payload,
|
|
1347
|
+
_init: lazyInitializer
|
|
1459
1348
|
};
|
|
1460
1349
|
|
|
1461
1350
|
{
|
|
1462
1351
|
// In production, this would just set it on the object.
|
|
1463
1352
|
var defaultProps;
|
|
1464
|
-
var propTypes;
|
|
1353
|
+
var propTypes; // $FlowFixMe
|
|
1354
|
+
|
|
1465
1355
|
Object.defineProperties(lazyType, {
|
|
1466
1356
|
defaultProps: {
|
|
1467
1357
|
configurable: true,
|
|
@@ -1472,6 +1362,7 @@
|
|
|
1472
1362
|
error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1473
1363
|
|
|
1474
1364
|
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1365
|
+
// $FlowFixMe
|
|
1475
1366
|
|
|
1476
1367
|
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1477
1368
|
enumerable: true
|
|
@@ -1487,6 +1378,7 @@
|
|
|
1487
1378
|
error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1488
1379
|
|
|
1489
1380
|
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1381
|
+
// $FlowFixMe
|
|
1490
1382
|
|
|
1491
1383
|
Object.defineProperty(lazyType, 'propTypes', {
|
|
1492
1384
|
enumerable: true
|
|
@@ -1518,15 +1410,53 @@
|
|
|
1518
1410
|
}
|
|
1519
1411
|
}
|
|
1520
1412
|
|
|
1521
|
-
|
|
1413
|
+
var elementType = {
|
|
1522
1414
|
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1523
1415
|
render: render
|
|
1524
1416
|
};
|
|
1417
|
+
|
|
1418
|
+
{
|
|
1419
|
+
var ownName;
|
|
1420
|
+
Object.defineProperty(elementType, 'displayName', {
|
|
1421
|
+
enumerable: false,
|
|
1422
|
+
configurable: true,
|
|
1423
|
+
get: function () {
|
|
1424
|
+
return ownName;
|
|
1425
|
+
},
|
|
1426
|
+
set: function (name) {
|
|
1427
|
+
ownName = name;
|
|
1428
|
+
|
|
1429
|
+
if (render.displayName == null) {
|
|
1430
|
+
render.displayName = name;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
return elementType;
|
|
1525
1437
|
}
|
|
1526
1438
|
|
|
1439
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1440
|
+
|
|
1441
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1442
|
+
|
|
1527
1443
|
function isValidElementType(type) {
|
|
1528
|
-
|
|
1529
|
-
|
|
1444
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1445
|
+
return true;
|
|
1446
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
1450
|
+
return true;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
if (typeof type === 'object' && type !== null) {
|
|
1454
|
+
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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1455
|
+
return true;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
return false;
|
|
1530
1460
|
}
|
|
1531
1461
|
|
|
1532
1462
|
function memo(type, compare) {
|
|
@@ -1536,11 +1466,31 @@
|
|
|
1536
1466
|
}
|
|
1537
1467
|
}
|
|
1538
1468
|
|
|
1539
|
-
|
|
1469
|
+
var elementType = {
|
|
1540
1470
|
$$typeof: REACT_MEMO_TYPE,
|
|
1541
1471
|
type: type,
|
|
1542
1472
|
compare: compare === undefined ? null : compare
|
|
1543
1473
|
};
|
|
1474
|
+
|
|
1475
|
+
{
|
|
1476
|
+
var ownName;
|
|
1477
|
+
Object.defineProperty(elementType, 'displayName', {
|
|
1478
|
+
enumerable: false,
|
|
1479
|
+
configurable: true,
|
|
1480
|
+
get: function () {
|
|
1481
|
+
return ownName;
|
|
1482
|
+
},
|
|
1483
|
+
set: function (name) {
|
|
1484
|
+
ownName = name;
|
|
1485
|
+
|
|
1486
|
+
if (type.displayName == null) {
|
|
1487
|
+
type.displayName = name;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
return elementType;
|
|
1544
1494
|
}
|
|
1545
1495
|
|
|
1546
1496
|
function resolveDispatcher() {
|
|
@@ -1548,7 +1498,7 @@
|
|
|
1548
1498
|
|
|
1549
1499
|
if (!(dispatcher !== null)) {
|
|
1550
1500
|
{
|
|
1551
|
-
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://
|
|
1501
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1552
1502
|
}
|
|
1553
1503
|
}
|
|
1554
1504
|
|
|
@@ -1560,7 +1510,7 @@
|
|
|
1560
1510
|
|
|
1561
1511
|
{
|
|
1562
1512
|
if (unstable_observedBits !== undefined) {
|
|
1563
|
-
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://
|
|
1513
|
+
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' : '');
|
|
1564
1514
|
} // TODO: add a more generic warning for invalid values.
|
|
1565
1515
|
|
|
1566
1516
|
|
|
@@ -1617,110 +1567,416 @@
|
|
|
1617
1567
|
}
|
|
1618
1568
|
}
|
|
1619
1569
|
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1570
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1571
|
+
// replaying on render function. This currently only patches the object
|
|
1572
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
1573
|
+
// We could also eagerly patch the method.
|
|
1574
|
+
var disabledDepth = 0;
|
|
1575
|
+
var prevLog;
|
|
1576
|
+
var prevInfo;
|
|
1577
|
+
var prevWarn;
|
|
1578
|
+
var prevError;
|
|
1579
|
+
var prevGroup;
|
|
1580
|
+
var prevGroupCollapsed;
|
|
1581
|
+
var prevGroupEnd;
|
|
1582
|
+
|
|
1583
|
+
function disabledLog() {}
|
|
1584
|
+
|
|
1585
|
+
disabledLog.__reactDisabledLog = true;
|
|
1586
|
+
function disableLogs() {
|
|
1587
|
+
{
|
|
1588
|
+
if (disabledDepth === 0) {
|
|
1589
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1590
|
+
prevLog = console.log;
|
|
1591
|
+
prevInfo = console.info;
|
|
1592
|
+
prevWarn = console.warn;
|
|
1593
|
+
prevError = console.error;
|
|
1594
|
+
prevGroup = console.group;
|
|
1595
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
1596
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
1597
|
+
|
|
1598
|
+
var props = {
|
|
1599
|
+
configurable: true,
|
|
1600
|
+
enumerable: true,
|
|
1601
|
+
value: disabledLog,
|
|
1602
|
+
writable: true
|
|
1603
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1604
|
+
|
|
1605
|
+
Object.defineProperties(console, {
|
|
1606
|
+
info: props,
|
|
1607
|
+
log: props,
|
|
1608
|
+
warn: props,
|
|
1609
|
+
error: props,
|
|
1610
|
+
group: props,
|
|
1611
|
+
groupCollapsed: props,
|
|
1612
|
+
groupEnd: props
|
|
1613
|
+
});
|
|
1614
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
disabledDepth++;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
function reenableLogs() {
|
|
1621
|
+
{
|
|
1622
|
+
disabledDepth--;
|
|
1623
|
+
|
|
1624
|
+
if (disabledDepth === 0) {
|
|
1625
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1626
|
+
var props = {
|
|
1627
|
+
configurable: true,
|
|
1628
|
+
enumerable: true,
|
|
1629
|
+
writable: true
|
|
1630
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1631
|
+
|
|
1632
|
+
Object.defineProperties(console, {
|
|
1633
|
+
log: assign({}, props, {
|
|
1634
|
+
value: prevLog
|
|
1635
|
+
}),
|
|
1636
|
+
info: assign({}, props, {
|
|
1637
|
+
value: prevInfo
|
|
1638
|
+
}),
|
|
1639
|
+
warn: assign({}, props, {
|
|
1640
|
+
value: prevWarn
|
|
1641
|
+
}),
|
|
1642
|
+
error: assign({}, props, {
|
|
1643
|
+
value: prevError
|
|
1644
|
+
}),
|
|
1645
|
+
group: assign({}, props, {
|
|
1646
|
+
value: prevGroup
|
|
1647
|
+
}),
|
|
1648
|
+
groupCollapsed: assign({}, props, {
|
|
1649
|
+
value: prevGroupCollapsed
|
|
1650
|
+
}),
|
|
1651
|
+
groupEnd: assign({}, props, {
|
|
1652
|
+
value: prevGroupEnd
|
|
1653
|
+
})
|
|
1654
|
+
});
|
|
1655
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
if (disabledDepth < 0) {
|
|
1659
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1626
1663
|
|
|
1627
|
-
var
|
|
1664
|
+
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1665
|
+
var prefix;
|
|
1666
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1667
|
+
{
|
|
1668
|
+
if (prefix === undefined) {
|
|
1669
|
+
// Extract the VM specific prefix used by each line.
|
|
1670
|
+
try {
|
|
1671
|
+
throw Error();
|
|
1672
|
+
} catch (x) {
|
|
1673
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1674
|
+
prefix = match && match[1] || '';
|
|
1675
|
+
}
|
|
1676
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1628
1677
|
|
|
1629
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
1630
1678
|
|
|
1631
|
-
|
|
1679
|
+
return '\n' + prefix + name;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
var reentry = false;
|
|
1683
|
+
var componentFrameCache;
|
|
1632
1684
|
|
|
1633
1685
|
{
|
|
1634
|
-
var
|
|
1635
|
-
|
|
1636
|
-
|
|
1686
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1687
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
1691
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1692
|
+
if (!fn || reentry) {
|
|
1693
|
+
return '';
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
{
|
|
1697
|
+
var frame = componentFrameCache.get(fn);
|
|
1637
1698
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
if (typeof console !== 'undefined') {
|
|
1641
|
-
console.error(message);
|
|
1699
|
+
if (frame !== undefined) {
|
|
1700
|
+
return frame;
|
|
1642
1701
|
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
var control;
|
|
1705
|
+
reentry = true;
|
|
1706
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
1707
|
+
|
|
1708
|
+
Error.prepareStackTrace = undefined;
|
|
1709
|
+
var previousDispatcher;
|
|
1710
|
+
|
|
1711
|
+
{
|
|
1712
|
+
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
1713
|
+
// for warnings.
|
|
1714
|
+
|
|
1715
|
+
ReactCurrentDispatcher$1.current = null;
|
|
1716
|
+
disableLogs();
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
try {
|
|
1720
|
+
// This should throw.
|
|
1721
|
+
if (construct) {
|
|
1722
|
+
// Something should be setting the props in the constructor.
|
|
1723
|
+
var Fake = function () {
|
|
1724
|
+
throw Error();
|
|
1725
|
+
}; // $FlowFixMe
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
1729
|
+
set: function () {
|
|
1730
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
1731
|
+
// because that won't throw in a non-strict mode function.
|
|
1732
|
+
throw Error();
|
|
1733
|
+
}
|
|
1734
|
+
});
|
|
1735
|
+
|
|
1736
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1737
|
+
// We construct a different control for this case to include any extra
|
|
1738
|
+
// frames added by the construct call.
|
|
1739
|
+
try {
|
|
1740
|
+
Reflect.construct(Fake, []);
|
|
1741
|
+
} catch (x) {
|
|
1742
|
+
control = x;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
Reflect.construct(fn, [], Fake);
|
|
1746
|
+
} else {
|
|
1747
|
+
try {
|
|
1748
|
+
Fake.call();
|
|
1749
|
+
} catch (x) {
|
|
1750
|
+
control = x;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
fn.call(Fake.prototype);
|
|
1754
|
+
}
|
|
1755
|
+
} else {
|
|
1756
|
+
try {
|
|
1757
|
+
throw Error();
|
|
1758
|
+
} catch (x) {
|
|
1759
|
+
control = x;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
fn();
|
|
1763
|
+
}
|
|
1764
|
+
} catch (sample) {
|
|
1765
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
1766
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
1767
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
1768
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
1769
|
+
var sampleLines = sample.stack.split('\n');
|
|
1770
|
+
var controlLines = control.stack.split('\n');
|
|
1771
|
+
var s = sampleLines.length - 1;
|
|
1772
|
+
var c = controlLines.length - 1;
|
|
1773
|
+
|
|
1774
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1775
|
+
// We expect at least one stack frame to be shared.
|
|
1776
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
1777
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
1778
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
1779
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
1780
|
+
// the sample somewhere in the control.
|
|
1781
|
+
c--;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1785
|
+
// Next we find the first one that isn't the same which should be the
|
|
1786
|
+
// frame that called our sample function and the control.
|
|
1787
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
1788
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
1789
|
+
// If we're about to return the first line, and the control is also on the same
|
|
1790
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
1791
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
1792
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
1793
|
+
if (s !== 1 || c !== 1) {
|
|
1794
|
+
do {
|
|
1795
|
+
s--;
|
|
1796
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
1797
|
+
// The next one that isn't the same should be our match though.
|
|
1798
|
+
|
|
1799
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1800
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1801
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1802
|
+
|
|
1803
|
+
{
|
|
1804
|
+
if (typeof fn === 'function') {
|
|
1805
|
+
componentFrameCache.set(fn, _frame);
|
|
1806
|
+
}
|
|
1807
|
+
} // Return the line we found.
|
|
1808
|
+
|
|
1809
|
+
|
|
1810
|
+
return _frame;
|
|
1811
|
+
}
|
|
1812
|
+
} while (s >= 1 && c >= 0);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
} finally {
|
|
1820
|
+
reentry = false;
|
|
1821
|
+
|
|
1822
|
+
{
|
|
1823
|
+
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1824
|
+
reenableLogs();
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1828
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
1832
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
1833
|
+
|
|
1834
|
+
{
|
|
1835
|
+
if (typeof fn === 'function') {
|
|
1836
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return syntheticFrame;
|
|
1841
|
+
}
|
|
1842
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1843
|
+
{
|
|
1844
|
+
return describeNativeComponentFrame(fn, false);
|
|
1845
|
+
}
|
|
1650
1846
|
}
|
|
1651
1847
|
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1848
|
+
function shouldConstruct(Component) {
|
|
1849
|
+
var prototype = Component.prototype;
|
|
1850
|
+
return !!(prototype && prototype.isReactComponent);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1854
|
+
|
|
1855
|
+
if (type == null) {
|
|
1856
|
+
return '';
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
if (typeof type === 'function') {
|
|
1860
|
+
{
|
|
1861
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
if (typeof type === 'string') {
|
|
1866
|
+
return describeBuiltInComponentFrame(type);
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
switch (type) {
|
|
1870
|
+
case exports.Suspense:
|
|
1871
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
1872
|
+
|
|
1873
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1874
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
if (typeof type === 'object') {
|
|
1878
|
+
switch (type.$$typeof) {
|
|
1879
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1880
|
+
return describeFunctionComponentFrame(type.render);
|
|
1881
|
+
|
|
1882
|
+
case REACT_MEMO_TYPE:
|
|
1883
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
1884
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1885
|
+
|
|
1886
|
+
case REACT_BLOCK_TYPE:
|
|
1887
|
+
return describeFunctionComponentFrame(type._render);
|
|
1888
|
+
|
|
1889
|
+
case REACT_LAZY_TYPE:
|
|
1890
|
+
{
|
|
1891
|
+
var lazyComponent = type;
|
|
1892
|
+
var payload = lazyComponent._payload;
|
|
1893
|
+
var init = lazyComponent._init;
|
|
1894
|
+
|
|
1895
|
+
try {
|
|
1896
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
1897
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1898
|
+
} catch (x) {}
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
return '';
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
var loggedTypeFailures = {};
|
|
1907
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1908
|
+
|
|
1909
|
+
function setCurrentlyValidatingElement(element) {
|
|
1910
|
+
{
|
|
1911
|
+
if (element) {
|
|
1912
|
+
var owner = element._owner;
|
|
1913
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1914
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1915
|
+
} else {
|
|
1916
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1664
1922
|
{
|
|
1923
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1924
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1925
|
+
|
|
1665
1926
|
for (var typeSpecName in typeSpecs) {
|
|
1666
1927
|
if (has(typeSpecs, typeSpecName)) {
|
|
1667
|
-
var error;
|
|
1668
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
1928
|
+
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
1669
1929
|
// fail the render phase where it didn't fail before. So we log it.
|
|
1670
1930
|
// After these have been cleaned up, we'll let them throw.
|
|
1931
|
+
|
|
1671
1932
|
try {
|
|
1672
1933
|
// This is intentionally an invariant that gets caught. It's the same
|
|
1673
1934
|
// behavior as without this statement except with a better message.
|
|
1674
1935
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
1675
|
-
var err = Error(
|
|
1676
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
1677
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
1678
|
-
);
|
|
1936
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
1679
1937
|
err.name = 'Invariant Violation';
|
|
1680
1938
|
throw err;
|
|
1681
1939
|
}
|
|
1682
|
-
|
|
1940
|
+
|
|
1941
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
1683
1942
|
} catch (ex) {
|
|
1684
|
-
error = ex;
|
|
1943
|
+
error$1 = ex;
|
|
1685
1944
|
}
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
'shape all require an argument).'
|
|
1694
|
-
);
|
|
1945
|
+
|
|
1946
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
1947
|
+
setCurrentlyValidatingElement(element);
|
|
1948
|
+
|
|
1949
|
+
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
1950
|
+
|
|
1951
|
+
setCurrentlyValidatingElement(null);
|
|
1695
1952
|
}
|
|
1696
|
-
|
|
1953
|
+
|
|
1954
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1697
1955
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1698
1956
|
// same error.
|
|
1699
|
-
loggedTypeFailures[error.message] = true;
|
|
1957
|
+
loggedTypeFailures[error$1.message] = true;
|
|
1958
|
+
setCurrentlyValidatingElement(element);
|
|
1700
1959
|
|
|
1701
|
-
|
|
1960
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
1702
1961
|
|
|
1703
|
-
|
|
1704
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
1705
|
-
);
|
|
1962
|
+
setCurrentlyValidatingElement(null);
|
|
1706
1963
|
}
|
|
1707
1964
|
}
|
|
1708
1965
|
}
|
|
1709
1966
|
}
|
|
1710
1967
|
}
|
|
1711
1968
|
|
|
1712
|
-
|
|
1713
|
-
* Resets warning cache when testing.
|
|
1714
|
-
*
|
|
1715
|
-
* @private
|
|
1716
|
-
*/
|
|
1717
|
-
checkPropTypes.resetWarningCache = function() {
|
|
1969
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1718
1970
|
{
|
|
1719
|
-
|
|
1971
|
+
if (element) {
|
|
1972
|
+
var owner = element._owner;
|
|
1973
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1974
|
+
setExtraStackFrame(stack);
|
|
1975
|
+
} else {
|
|
1976
|
+
setExtraStackFrame(null);
|
|
1977
|
+
}
|
|
1720
1978
|
}
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
var checkPropTypes_1 = checkPropTypes;
|
|
1979
|
+
}
|
|
1724
1980
|
|
|
1725
1981
|
var propTypesMisspellWarningShown;
|
|
1726
1982
|
|
|
@@ -1815,13 +2071,13 @@
|
|
|
1815
2071
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1816
2072
|
}
|
|
1817
2073
|
|
|
1818
|
-
setCurrentlyValidatingElement(element);
|
|
1819
|
-
|
|
1820
2074
|
{
|
|
1821
|
-
|
|
1822
|
-
}
|
|
2075
|
+
setCurrentlyValidatingElement$1(element);
|
|
1823
2076
|
|
|
1824
|
-
|
|
2077
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
2078
|
+
|
|
2079
|
+
setCurrentlyValidatingElement$1(null);
|
|
2080
|
+
}
|
|
1825
2081
|
}
|
|
1826
2082
|
/**
|
|
1827
2083
|
* Ensure that every element either is passed in a static location, in an
|
|
@@ -1887,7 +2143,6 @@
|
|
|
1887
2143
|
return;
|
|
1888
2144
|
}
|
|
1889
2145
|
|
|
1890
|
-
var name = getComponentName(type);
|
|
1891
2146
|
var propTypes;
|
|
1892
2147
|
|
|
1893
2148
|
if (typeof type === 'function') {
|
|
@@ -1901,13 +2156,15 @@
|
|
|
1901
2156
|
}
|
|
1902
2157
|
|
|
1903
2158
|
if (propTypes) {
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2159
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
2160
|
+
var name = getComponentName(type);
|
|
2161
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1907
2162
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1908
|
-
propTypesMisspellWarningShown = true;
|
|
2163
|
+
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1909
2164
|
|
|
1910
|
-
|
|
2165
|
+
var _name = getComponentName(type);
|
|
2166
|
+
|
|
2167
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1911
2168
|
}
|
|
1912
2169
|
|
|
1913
2170
|
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
@@ -1923,24 +2180,28 @@
|
|
|
1923
2180
|
|
|
1924
2181
|
function validateFragmentProps(fragment) {
|
|
1925
2182
|
{
|
|
1926
|
-
setCurrentlyValidatingElement(fragment);
|
|
1927
2183
|
var keys = Object.keys(fragment.props);
|
|
1928
2184
|
|
|
1929
2185
|
for (var i = 0; i < keys.length; i++) {
|
|
1930
2186
|
var key = keys[i];
|
|
1931
2187
|
|
|
1932
2188
|
if (key !== 'children' && key !== 'key') {
|
|
2189
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2190
|
+
|
|
1933
2191
|
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1934
2192
|
|
|
2193
|
+
setCurrentlyValidatingElement$1(null);
|
|
1935
2194
|
break;
|
|
1936
2195
|
}
|
|
1937
2196
|
}
|
|
1938
2197
|
|
|
1939
2198
|
if (fragment.ref !== null) {
|
|
2199
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2200
|
+
|
|
1940
2201
|
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1941
|
-
}
|
|
1942
2202
|
|
|
1943
|
-
|
|
2203
|
+
setCurrentlyValidatingElement$1(null);
|
|
2204
|
+
}
|
|
1944
2205
|
}
|
|
1945
2206
|
}
|
|
1946
2207
|
function createElementWithValidation(type, props, children) {
|
|
@@ -1998,7 +2259,7 @@
|
|
|
1998
2259
|
}
|
|
1999
2260
|
}
|
|
2000
2261
|
|
|
2001
|
-
if (type ===
|
|
2262
|
+
if (type === exports.Fragment) {
|
|
2002
2263
|
validateFragmentProps(element);
|
|
2003
2264
|
} else {
|
|
2004
2265
|
validatePropTypes(element);
|
|
@@ -2055,6 +2316,22 @@
|
|
|
2055
2316
|
var requestPaint;
|
|
2056
2317
|
var getCurrentTime;
|
|
2057
2318
|
var forceFrameRate;
|
|
2319
|
+
var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
|
|
2320
|
+
|
|
2321
|
+
if (hasPerformanceNow) {
|
|
2322
|
+
var localPerformance = performance;
|
|
2323
|
+
|
|
2324
|
+
getCurrentTime = function () {
|
|
2325
|
+
return localPerformance.now();
|
|
2326
|
+
};
|
|
2327
|
+
} else {
|
|
2328
|
+
var localDate = Date;
|
|
2329
|
+
var initialTime = localDate.now();
|
|
2330
|
+
|
|
2331
|
+
getCurrentTime = function () {
|
|
2332
|
+
return localDate.now() - initialTime;
|
|
2333
|
+
};
|
|
2334
|
+
}
|
|
2058
2335
|
|
|
2059
2336
|
if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
|
|
2060
2337
|
// implementation using setTimeout.
|
|
@@ -2081,12 +2358,6 @@
|
|
|
2081
2358
|
}
|
|
2082
2359
|
};
|
|
2083
2360
|
|
|
2084
|
-
var initialTime = Date.now();
|
|
2085
|
-
|
|
2086
|
-
getCurrentTime = function () {
|
|
2087
|
-
return Date.now() - initialTime;
|
|
2088
|
-
};
|
|
2089
|
-
|
|
2090
2361
|
requestHostCallback = function (cb) {
|
|
2091
2362
|
if (_callback !== null) {
|
|
2092
2363
|
// Protect against re-entrancy.
|
|
@@ -2112,8 +2383,6 @@
|
|
|
2112
2383
|
requestPaint = forceFrameRate = function () {};
|
|
2113
2384
|
} else {
|
|
2114
2385
|
// Capture local references to native APIs, in case a polyfill overrides them.
|
|
2115
|
-
var performance = window.performance;
|
|
2116
|
-
var _Date = window.Date;
|
|
2117
2386
|
var _setTimeout = window.setTimeout;
|
|
2118
2387
|
var _clearTimeout = window.clearTimeout;
|
|
2119
2388
|
|
|
@@ -2122,31 +2391,19 @@
|
|
|
2122
2391
|
// maybe we want to continue warning if they don't exist, to preserve the
|
|
2123
2392
|
// option to rely on it in the future?
|
|
2124
2393
|
var requestAnimationFrame = window.requestAnimationFrame;
|
|
2125
|
-
var cancelAnimationFrame = window.cancelAnimationFrame;
|
|
2394
|
+
var cancelAnimationFrame = window.cancelAnimationFrame;
|
|
2126
2395
|
|
|
2127
2396
|
if (typeof requestAnimationFrame !== 'function') {
|
|
2128
2397
|
// Using console['error'] to evade Babel and ESLint
|
|
2129
|
-
console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://
|
|
2398
|
+
console['error']("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
|
|
2130
2399
|
}
|
|
2131
2400
|
|
|
2132
2401
|
if (typeof cancelAnimationFrame !== 'function') {
|
|
2133
2402
|
// Using console['error'] to evade Babel and ESLint
|
|
2134
|
-
console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://
|
|
2403
|
+
console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills');
|
|
2135
2404
|
}
|
|
2136
2405
|
}
|
|
2137
2406
|
|
|
2138
|
-
if (typeof performance === 'object' && typeof performance.now === 'function') {
|
|
2139
|
-
getCurrentTime = function () {
|
|
2140
|
-
return performance.now();
|
|
2141
|
-
};
|
|
2142
|
-
} else {
|
|
2143
|
-
var _initialTime = _Date.now();
|
|
2144
|
-
|
|
2145
|
-
getCurrentTime = function () {
|
|
2146
|
-
return _Date.now() - _initialTime;
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2407
|
var isMessageLoopRunning = false;
|
|
2151
2408
|
var scheduledHostCallback = null;
|
|
2152
2409
|
var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
|
|
@@ -2171,7 +2428,7 @@
|
|
|
2171
2428
|
forceFrameRate = function (fps) {
|
|
2172
2429
|
if (fps < 0 || fps > 125) {
|
|
2173
2430
|
// Using console['error'] to evade Babel and ESLint
|
|
2174
|
-
console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing
|
|
2431
|
+
console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
|
|
2175
2432
|
return;
|
|
2176
2433
|
}
|
|
2177
2434
|
|
|
@@ -2499,11 +2756,11 @@
|
|
|
2499
2756
|
|
|
2500
2757
|
var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
|
|
2501
2758
|
|
|
2502
|
-
var
|
|
2759
|
+
var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
|
2503
2760
|
var NORMAL_PRIORITY_TIMEOUT = 5000;
|
|
2504
2761
|
var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
|
|
2505
2762
|
|
|
2506
|
-
var
|
|
2763
|
+
var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
|
|
2507
2764
|
|
|
2508
2765
|
var taskQueue = [];
|
|
2509
2766
|
var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
|
|
@@ -2592,7 +2849,7 @@
|
|
|
2592
2849
|
throw error;
|
|
2593
2850
|
}
|
|
2594
2851
|
} else {
|
|
2595
|
-
// No catch in prod
|
|
2852
|
+
// No catch in prod code path.
|
|
2596
2853
|
return workLoop(hasTimeRemaining, initialTime);
|
|
2597
2854
|
}
|
|
2598
2855
|
} finally {
|
|
@@ -2621,7 +2878,7 @@
|
|
|
2621
2878
|
|
|
2622
2879
|
var callback = currentTask.callback;
|
|
2623
2880
|
|
|
2624
|
-
if (callback
|
|
2881
|
+
if (typeof callback === 'function') {
|
|
2625
2882
|
currentTask.callback = null;
|
|
2626
2883
|
currentPriorityLevel = currentTask.priorityLevel;
|
|
2627
2884
|
var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
|
@@ -2730,30 +2987,9 @@
|
|
|
2730
2987
|
};
|
|
2731
2988
|
}
|
|
2732
2989
|
|
|
2733
|
-
function timeoutForPriorityLevel(priorityLevel) {
|
|
2734
|
-
switch (priorityLevel) {
|
|
2735
|
-
case ImmediatePriority:
|
|
2736
|
-
return IMMEDIATE_PRIORITY_TIMEOUT;
|
|
2737
|
-
|
|
2738
|
-
case UserBlockingPriority:
|
|
2739
|
-
return USER_BLOCKING_PRIORITY;
|
|
2740
|
-
|
|
2741
|
-
case IdlePriority:
|
|
2742
|
-
return IDLE_PRIORITY;
|
|
2743
|
-
|
|
2744
|
-
case LowPriority:
|
|
2745
|
-
return LOW_PRIORITY_TIMEOUT;
|
|
2746
|
-
|
|
2747
|
-
case NormalPriority:
|
|
2748
|
-
default:
|
|
2749
|
-
return NORMAL_PRIORITY_TIMEOUT;
|
|
2750
|
-
}
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
2990
|
function unstable_scheduleCallback(priorityLevel, callback, options) {
|
|
2754
2991
|
var currentTime = getCurrentTime();
|
|
2755
2992
|
var startTime;
|
|
2756
|
-
var timeout;
|
|
2757
2993
|
|
|
2758
2994
|
if (typeof options === 'object' && options !== null) {
|
|
2759
2995
|
var delay = options.delay;
|
|
@@ -2763,13 +2999,35 @@
|
|
|
2763
2999
|
} else {
|
|
2764
3000
|
startTime = currentTime;
|
|
2765
3001
|
}
|
|
2766
|
-
|
|
2767
|
-
timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
|
|
2768
3002
|
} else {
|
|
2769
|
-
timeout = timeoutForPriorityLevel(priorityLevel);
|
|
2770
3003
|
startTime = currentTime;
|
|
2771
3004
|
}
|
|
2772
3005
|
|
|
3006
|
+
var timeout;
|
|
3007
|
+
|
|
3008
|
+
switch (priorityLevel) {
|
|
3009
|
+
case ImmediatePriority:
|
|
3010
|
+
timeout = IMMEDIATE_PRIORITY_TIMEOUT;
|
|
3011
|
+
break;
|
|
3012
|
+
|
|
3013
|
+
case UserBlockingPriority:
|
|
3014
|
+
timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
|
|
3015
|
+
break;
|
|
3016
|
+
|
|
3017
|
+
case IdlePriority:
|
|
3018
|
+
timeout = IDLE_PRIORITY_TIMEOUT;
|
|
3019
|
+
break;
|
|
3020
|
+
|
|
3021
|
+
case LowPriority:
|
|
3022
|
+
timeout = LOW_PRIORITY_TIMEOUT;
|
|
3023
|
+
break;
|
|
3024
|
+
|
|
3025
|
+
case NormalPriority:
|
|
3026
|
+
default:
|
|
3027
|
+
timeout = NORMAL_PRIORITY_TIMEOUT;
|
|
3028
|
+
break;
|
|
3029
|
+
}
|
|
3030
|
+
|
|
2773
3031
|
var expirationTime = startTime + timeout;
|
|
2774
3032
|
var newTask = {
|
|
2775
3033
|
id: taskIdCounter++,
|
|
@@ -2855,13 +3113,6 @@
|
|
|
2855
3113
|
return currentPriorityLevel;
|
|
2856
3114
|
}
|
|
2857
3115
|
|
|
2858
|
-
function unstable_shouldYield() {
|
|
2859
|
-
var currentTime = getCurrentTime();
|
|
2860
|
-
advanceTimers(currentTime);
|
|
2861
|
-
var firstTask = peek(taskQueue);
|
|
2862
|
-
return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
|
|
2863
|
-
}
|
|
2864
|
-
|
|
2865
3116
|
var unstable_requestPaint = requestPaint;
|
|
2866
3117
|
var unstable_Profiling = {
|
|
2867
3118
|
startLoggingProfilingEvents: startLoggingProfilingEvents,
|
|
@@ -2884,7 +3135,7 @@
|
|
|
2884
3135
|
unstable_cancelCallback: unstable_cancelCallback,
|
|
2885
3136
|
unstable_wrapCallback: unstable_wrapCallback,
|
|
2886
3137
|
unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
|
|
2887
|
-
unstable_shouldYield
|
|
3138
|
+
get unstable_shouldYield () { return shouldYieldToHost; },
|
|
2888
3139
|
unstable_requestPaint: unstable_requestPaint,
|
|
2889
3140
|
unstable_continueExecution: unstable_continueExecution,
|
|
2890
3141
|
unstable_pauseExecution: unstable_pauseExecution,
|
|
@@ -3236,41 +3487,31 @@
|
|
|
3236
3487
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
3237
3488
|
ReactCurrentOwner: ReactCurrentOwner,
|
|
3238
3489
|
IsSomeRendererActing: IsSomeRendererActing,
|
|
3490
|
+
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
3239
3491
|
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
3240
|
-
assign:
|
|
3492
|
+
assign: assign,
|
|
3493
|
+
// Re-export the schedule API(s) for UMD bundles.
|
|
3494
|
+
// This avoids introducing a dependency on a new UMD global in a minor update,
|
|
3495
|
+
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
|
|
3496
|
+
// This re-export is only required for UMD bundles;
|
|
3497
|
+
// CJS bundles use the shared NPM package.
|
|
3498
|
+
Scheduler: Scheduler,
|
|
3499
|
+
SchedulerTracing: SchedulerTracing
|
|
3241
3500
|
};
|
|
3242
3501
|
|
|
3243
3502
|
{
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
3247
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
3248
|
-
// TODO: remove in React 17.0.
|
|
3249
|
-
ReactComponentTreeHook: {}
|
|
3250
|
-
});
|
|
3251
|
-
} // Re-export the schedule API(s) for UMD bundles.
|
|
3252
|
-
// This avoids introducing a dependency on a new UMD global in a minor update,
|
|
3253
|
-
// Since that would be a breaking change (e.g. for all existing CodeSandboxes).
|
|
3254
|
-
// This re-export is only required for UMD bundles;
|
|
3255
|
-
// CJS bundles use the shared NPM package.
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
objectAssign(ReactSharedInternals$1, {
|
|
3259
|
-
Scheduler: Scheduler,
|
|
3260
|
-
SchedulerTracing: SchedulerTracing
|
|
3261
|
-
});
|
|
3503
|
+
ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
3504
|
+
}
|
|
3262
3505
|
|
|
3263
3506
|
{
|
|
3264
3507
|
|
|
3265
3508
|
try {
|
|
3266
3509
|
var frozenObject = Object.freeze({});
|
|
3267
|
-
|
|
3268
|
-
var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
|
|
3269
|
-
// https://github.com/rollup/rollup/issues/1771
|
|
3270
|
-
// TODO: we can remove these if Rollup fixes the bug.
|
|
3510
|
+
/* eslint-disable no-new */
|
|
3271
3511
|
|
|
3272
|
-
|
|
3273
|
-
|
|
3512
|
+
new Map([[frozenObject, null]]);
|
|
3513
|
+
new Set([frozenObject]);
|
|
3514
|
+
/* eslint-enable no-new */
|
|
3274
3515
|
} catch (e) {
|
|
3275
3516
|
}
|
|
3276
3517
|
}
|
|
@@ -3288,11 +3529,7 @@
|
|
|
3288
3529
|
|
|
3289
3530
|
exports.Children = Children;
|
|
3290
3531
|
exports.Component = Component;
|
|
3291
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
3292
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
3293
3532
|
exports.PureComponent = PureComponent;
|
|
3294
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
3295
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
3296
3533
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1;
|
|
3297
3534
|
exports.cloneElement = cloneElement$1;
|
|
3298
3535
|
exports.createContext = createContext;
|