react 0.0.0-experimental-e5d06e34b → 0.0.0-experimental-ede917064
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +4 -4
- package/cjs/react-jsx-dev-runtime.development.js +418 -35
- package/cjs/react-jsx-dev-runtime.production.min.js +2 -3
- package/cjs/react-jsx-dev-runtime.profiling.min.js +2 -3
- package/cjs/react-jsx-runtime.development.js +418 -35
- package/cjs/react-jsx-runtime.production.min.js +2 -3
- package/cjs/react-jsx-runtime.profiling.min.js +2 -3
- package/cjs/react-unstable-cache.development.js +52 -0
- package/cjs/react-unstable-cache.production.min.js +10 -0
- package/cjs/react-unstable-cache.profiling.min.js +10 -0
- package/cjs/react.development.js +436 -186
- package/cjs/react.production.min.js +14 -13
- package/package.json +3 -2
- package/umd/react.development.js +480 -236
- package/umd/react.production.min.js +26 -25
- package/umd/react.profiling.min.js +33 -32
- package/unstable-cache.js +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
2
|
* react-jsx-runtime.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
'use strict';var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
9
|
+
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
11
10
|
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
2
|
* react-jsx-runtime.profiling.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
'use strict';var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
9
|
+
'use strict';require("object-assign");var f=require("react"),g=60103;exports.Fragment=60107;if("function"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h("react.element");exports.Fragment=h("react.fragment")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
11
10
|
function q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=""+k);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
|
+
* react-unstable-cache.development.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
(function() {
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
var react = require('react');
|
|
17
|
+
|
|
18
|
+
// TODO: should there be a default cache?
|
|
19
|
+
var CacheContext = react.createContext(null);
|
|
20
|
+
|
|
21
|
+
function CacheImpl() {
|
|
22
|
+
this.resources = new Map(); // TODO: cancellation token.
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function createCache() {
|
|
26
|
+
// $FlowFixMe
|
|
27
|
+
return new CacheImpl();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readCache() {
|
|
31
|
+
// TODO: this doesn't subscribe.
|
|
32
|
+
// But we really want load context anyway.
|
|
33
|
+
var value = CacheContext._currentValue;
|
|
34
|
+
|
|
35
|
+
if (value instanceof CacheImpl) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
{
|
|
40
|
+
{
|
|
41
|
+
throw Error( "Could not read the cache." );
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var CacheProvider = CacheContext.Provider;
|
|
47
|
+
|
|
48
|
+
exports.CacheProvider = CacheProvider;
|
|
49
|
+
exports.createCache = createCache;
|
|
50
|
+
exports.readCache = readCache;
|
|
51
|
+
})();
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
|
+
* react-unstable-cache.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
'use strict';function d(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,b=1;b<arguments.length;b++)c+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var e=require("react").createContext(null);function f(){this.resources=new Map}exports.CacheProvider=e.Provider;exports.createCache=function(){return new f};
|
|
10
|
+
exports.readCache=function(){var a=e._currentValue;if(a instanceof f)return a;throw Error(d(356));};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
|
+
* react-unstable-cache.profiling.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
'use strict';function d(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,b=1;b<arguments.length;b++)c+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var e=require("react").createContext(null);function f(){this.resources=new Map}exports.CacheProvider=e.Provider;exports.createCache=function(){return new f};
|
|
10
|
+
exports.readCache=function(){var a=e._currentValue;if(a instanceof f)return a;throw Error(d(356));};
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v0.0.0-experimental-
|
|
1
|
+
/** @license React v0.0.0-experimental-ede917064
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
12
|
if (process.env.NODE_ENV !== "production") {
|
|
15
13
|
(function() {
|
|
16
14
|
'use strict';
|
|
@@ -18,8 +16,11 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
16
|
var _assign = require('object-assign');
|
|
19
17
|
|
|
20
18
|
// TODO: this is special because it gets imported during build.
|
|
21
|
-
var ReactVersion = '
|
|
19
|
+
var ReactVersion = '17.0.0-alpha.0-experimental-ede917064';
|
|
22
20
|
|
|
21
|
+
// ATTENTION
|
|
22
|
+
// When adding new symbols to this file,
|
|
23
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
23
24
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
24
25
|
// nor polyfill, then a plain number is used for performance.
|
|
25
26
|
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
@@ -31,7 +32,7 @@ var REACT_PROVIDER_TYPE = 0xeacd;
|
|
|
31
32
|
var REACT_CONTEXT_TYPE = 0xeace;
|
|
32
33
|
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
33
34
|
exports.Suspense = 0xead1;
|
|
34
|
-
exports.
|
|
35
|
+
exports.unstable_SuspenseList = 0xead8;
|
|
35
36
|
var REACT_MEMO_TYPE = 0xead3;
|
|
36
37
|
var REACT_LAZY_TYPE = 0xead4;
|
|
37
38
|
var REACT_BLOCK_TYPE = 0xead9;
|
|
@@ -40,6 +41,9 @@ var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
|
40
41
|
var REACT_RESPONDER_TYPE = 0xead6;
|
|
41
42
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
42
43
|
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
44
|
+
exports.unstable_DebugTracingMode = 0xeae1;
|
|
45
|
+
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
46
|
+
exports.unstable_LegacyHidden = 0xeae3;
|
|
43
47
|
|
|
44
48
|
if (typeof Symbol === 'function' && Symbol.for) {
|
|
45
49
|
var symbolFor = Symbol.for;
|
|
@@ -52,7 +56,7 @@ if (typeof Symbol === 'function' && Symbol.for) {
|
|
|
52
56
|
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
53
57
|
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
54
58
|
exports.Suspense = symbolFor('react.suspense');
|
|
55
|
-
exports.
|
|
59
|
+
exports.unstable_SuspenseList = symbolFor('react.suspense_list');
|
|
56
60
|
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
57
61
|
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
58
62
|
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
@@ -61,6 +65,9 @@ if (typeof Symbol === 'function' && Symbol.for) {
|
|
|
61
65
|
REACT_RESPONDER_TYPE = symbolFor('react.responder');
|
|
62
66
|
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
63
67
|
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
68
|
+
exports.unstable_DebugTracingMode = symbolFor('react.debug_trace_mode');
|
|
69
|
+
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
70
|
+
exports.unstable_LegacyHidden = symbolFor('react.legacy_hidden');
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
@@ -112,136 +119,18 @@ var ReactCurrentOwner = {
|
|
|
112
119
|
current: null
|
|
113
120
|
};
|
|
114
121
|
|
|
115
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
116
|
-
|
|
117
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
118
|
-
var sourceInfo = '';
|
|
119
|
-
|
|
120
|
-
if ( source) {
|
|
121
|
-
var path = source.fileName;
|
|
122
|
-
var fileName = path.replace(BEFORE_SLASH_RE, ''); // In DEV, include code for a common special case:
|
|
123
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
124
|
-
|
|
125
|
-
if (/^index\./.test(fileName)) {
|
|
126
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
127
|
-
|
|
128
|
-
if (match) {
|
|
129
|
-
var pathBeforeSlash = match[1];
|
|
130
|
-
|
|
131
|
-
if (pathBeforeSlash) {
|
|
132
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
133
|
-
fileName = folderName + '/' + fileName;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
139
|
-
} else if (ownerName) {
|
|
140
|
-
sourceInfo = ' (created by ' + ownerName + ')';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
147
|
-
var ownerName = null;
|
|
148
|
-
|
|
149
|
-
if ( ownerFn) {
|
|
150
|
-
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return describeComponentFrame(name, source, ownerName);
|
|
154
|
-
}
|
|
155
|
-
function describeClassComponentFrame(ctor, source, ownerFn) {
|
|
156
|
-
return describeFunctionComponentFrame(ctor, source, ownerFn);
|
|
157
|
-
}
|
|
158
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
159
|
-
if (!fn) {
|
|
160
|
-
return '';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
var name = fn.displayName || fn.name || null;
|
|
164
|
-
var ownerName = null;
|
|
165
|
-
|
|
166
|
-
if ( ownerFn) {
|
|
167
|
-
ownerName = ownerFn.displayName || ownerFn.name || null;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return describeComponentFrame(name, source, ownerName);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function shouldConstruct(Component) {
|
|
174
|
-
var prototype = Component.prototype;
|
|
175
|
-
return !!(prototype && prototype.isReactComponent);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
179
|
-
|
|
180
|
-
if (type == null) {
|
|
181
|
-
return '';
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (typeof type === 'function') {
|
|
185
|
-
if (shouldConstruct(type)) {
|
|
186
|
-
return describeClassComponentFrame(type, source, ownerFn);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return describeFunctionComponentFrame(type, source, ownerFn);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (typeof type === 'string') {
|
|
193
|
-
return describeBuiltInComponentFrame(type, source, ownerFn);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
switch (type) {
|
|
197
|
-
case exports.Suspense:
|
|
198
|
-
return describeBuiltInComponentFrame('Suspense', source, ownerFn);
|
|
199
|
-
|
|
200
|
-
case exports.SuspenseList:
|
|
201
|
-
return describeBuiltInComponentFrame('SuspenseList', source, ownerFn);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (typeof type === 'object') {
|
|
205
|
-
switch (type.$$typeof) {
|
|
206
|
-
case REACT_FORWARD_REF_TYPE:
|
|
207
|
-
return describeFunctionComponentFrame(type.render, source, ownerFn);
|
|
208
|
-
|
|
209
|
-
case REACT_MEMO_TYPE:
|
|
210
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
211
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
212
|
-
|
|
213
|
-
case REACT_BLOCK_TYPE:
|
|
214
|
-
return describeFunctionComponentFrame(type._render, source, ownerFn);
|
|
215
|
-
|
|
216
|
-
case REACT_LAZY_TYPE:
|
|
217
|
-
{
|
|
218
|
-
var lazyComponent = type;
|
|
219
|
-
var payload = lazyComponent._payload;
|
|
220
|
-
var init = lazyComponent._init;
|
|
221
|
-
|
|
222
|
-
try {
|
|
223
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
224
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
225
|
-
} catch (x) {}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
return '';
|
|
231
|
-
}
|
|
232
|
-
|
|
233
122
|
var ReactDebugCurrentFrame = {};
|
|
234
|
-
var
|
|
235
|
-
function
|
|
123
|
+
var currentExtraStackFrame = null;
|
|
124
|
+
function setExtraStackFrame(stack) {
|
|
236
125
|
{
|
|
237
|
-
|
|
126
|
+
currentExtraStackFrame = stack;
|
|
238
127
|
}
|
|
239
128
|
}
|
|
240
129
|
|
|
241
130
|
{
|
|
242
|
-
ReactDebugCurrentFrame.
|
|
131
|
+
ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
|
243
132
|
{
|
|
244
|
-
|
|
133
|
+
currentExtraStackFrame = stack;
|
|
245
134
|
}
|
|
246
135
|
}; // Stack implementation injected by the current renderer.
|
|
247
136
|
|
|
@@ -251,9 +140,8 @@ function setCurrentlyValidatingElement(element) {
|
|
|
251
140
|
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
252
141
|
var stack = ''; // Add an extra top frame while an element is being validated
|
|
253
142
|
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
stack += describeUnknownElementTypeFrameInDEV(currentlyValidatingElement.type, currentlyValidatingElement._source, owner ? owner.type : null);
|
|
143
|
+
if (currentExtraStackFrame) {
|
|
144
|
+
stack += currentExtraStackFrame;
|
|
257
145
|
} // Delegate to the injected renderer-specific implementation
|
|
258
146
|
|
|
259
147
|
|
|
@@ -284,13 +172,7 @@ var ReactSharedInternals = {
|
|
|
284
172
|
};
|
|
285
173
|
|
|
286
174
|
{
|
|
287
|
-
|
|
288
|
-
// These should not be included in production.
|
|
289
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
290
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
291
|
-
// TODO: remove in React 17.0.
|
|
292
|
-
ReactComponentTreeHook: {}
|
|
293
|
-
});
|
|
175
|
+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
294
176
|
}
|
|
295
177
|
|
|
296
178
|
// by calls to these methods by a Babel plugin.
|
|
@@ -321,16 +203,12 @@ function printWarning(level, format, args) {
|
|
|
321
203
|
// When changing this logic, you might want to also
|
|
322
204
|
// update consoleWithStackDev.www.js as well.
|
|
323
205
|
{
|
|
324
|
-
var
|
|
325
|
-
|
|
326
|
-
if (!hasExistingStack) {
|
|
327
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
328
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
206
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
207
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
329
208
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
}
|
|
209
|
+
if (stack !== '') {
|
|
210
|
+
format += '%s';
|
|
211
|
+
args = args.concat([stack]);
|
|
334
212
|
}
|
|
335
213
|
|
|
336
214
|
var argsWithFormat = args.map(function (item) {
|
|
@@ -342,17 +220,6 @@ function printWarning(level, format, args) {
|
|
|
342
220
|
// eslint-disable-next-line react-internal/no-production-logging
|
|
343
221
|
|
|
344
222
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
345
|
-
|
|
346
|
-
try {
|
|
347
|
-
// --- Welcome to debugging React ---
|
|
348
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
349
|
-
// to find the callsite that caused this warning to fire.
|
|
350
|
-
var argIndex = 0;
|
|
351
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
352
|
-
return args[argIndex++];
|
|
353
|
-
});
|
|
354
|
-
throw new Error(message);
|
|
355
|
-
} catch (x) {}
|
|
356
223
|
}
|
|
357
224
|
}
|
|
358
225
|
|
|
@@ -628,7 +495,7 @@ function getComponentName(type) {
|
|
|
628
495
|
case exports.Suspense:
|
|
629
496
|
return 'Suspense';
|
|
630
497
|
|
|
631
|
-
case exports.
|
|
498
|
+
case exports.unstable_SuspenseList:
|
|
632
499
|
return 'SuspenseList';
|
|
633
500
|
}
|
|
634
501
|
|
|
@@ -1165,17 +1032,11 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
|
1165
1032
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1166
1033
|
}
|
|
1167
1034
|
} else if (type === 'object') {
|
|
1168
|
-
var addendum = '';
|
|
1169
|
-
|
|
1170
|
-
{
|
|
1171
|
-
addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
1035
|
var childrenString = '' + children;
|
|
1175
1036
|
|
|
1176
1037
|
{
|
|
1177
1038
|
{
|
|
1178
|
-
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ").
|
|
1039
|
+
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." );
|
|
1179
1040
|
}
|
|
1180
1041
|
}
|
|
1181
1042
|
}
|
|
@@ -1189,7 +1050,7 @@ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
|
1189
1050
|
*
|
|
1190
1051
|
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1191
1052
|
*
|
|
1192
|
-
* The provided mapFunction(child,
|
|
1053
|
+
* The provided mapFunction(child, index) will be called for each
|
|
1193
1054
|
* leaf child.
|
|
1194
1055
|
*
|
|
1195
1056
|
* @param {?*} children Children tree container.
|
|
@@ -1552,9 +1413,27 @@ function forwardRef(render) {
|
|
|
1552
1413
|
return elementType;
|
|
1553
1414
|
}
|
|
1554
1415
|
|
|
1416
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1417
|
+
|
|
1418
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1419
|
+
|
|
1555
1420
|
function isValidElementType(type) {
|
|
1556
|
-
|
|
1557
|
-
|
|
1421
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1422
|
+
return true;
|
|
1423
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
if (type === exports.Fragment || type === exports.Profiler || type === exports.unstable_DebugTracingMode || type === exports.StrictMode || type === exports.Suspense || type === exports.unstable_SuspenseList || type === exports.unstable_LegacyHidden || enableScopeAPI ) {
|
|
1427
|
+
return true;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
if (typeof type === 'object' && type !== null) {
|
|
1431
|
+
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_RESPONDER_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1432
|
+
return true;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
return false;
|
|
1558
1437
|
}
|
|
1559
1438
|
|
|
1560
1439
|
function memo(type, compare) {
|
|
@@ -1755,8 +1634,358 @@ function withSuspenseConfig(scope, config) {
|
|
|
1755
1634
|
}
|
|
1756
1635
|
}
|
|
1757
1636
|
|
|
1637
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1638
|
+
// replaying on render function. This currently only patches the object
|
|
1639
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
1640
|
+
// We could also eagerly patch the method.
|
|
1641
|
+
var disabledDepth = 0;
|
|
1642
|
+
var prevLog;
|
|
1643
|
+
var prevInfo;
|
|
1644
|
+
var prevWarn;
|
|
1645
|
+
var prevError;
|
|
1646
|
+
var prevGroup;
|
|
1647
|
+
var prevGroupCollapsed;
|
|
1648
|
+
var prevGroupEnd;
|
|
1649
|
+
|
|
1650
|
+
function disabledLog() {}
|
|
1651
|
+
|
|
1652
|
+
disabledLog.__reactDisabledLog = true;
|
|
1653
|
+
function disableLogs() {
|
|
1654
|
+
{
|
|
1655
|
+
if (disabledDepth === 0) {
|
|
1656
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1657
|
+
prevLog = console.log;
|
|
1658
|
+
prevInfo = console.info;
|
|
1659
|
+
prevWarn = console.warn;
|
|
1660
|
+
prevError = console.error;
|
|
1661
|
+
prevGroup = console.group;
|
|
1662
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
1663
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
1664
|
+
|
|
1665
|
+
var props = {
|
|
1666
|
+
configurable: true,
|
|
1667
|
+
enumerable: true,
|
|
1668
|
+
value: disabledLog,
|
|
1669
|
+
writable: true
|
|
1670
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1671
|
+
|
|
1672
|
+
Object.defineProperties(console, {
|
|
1673
|
+
info: props,
|
|
1674
|
+
log: props,
|
|
1675
|
+
warn: props,
|
|
1676
|
+
error: props,
|
|
1677
|
+
group: props,
|
|
1678
|
+
groupCollapsed: props,
|
|
1679
|
+
groupEnd: props
|
|
1680
|
+
});
|
|
1681
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
disabledDepth++;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
function reenableLogs() {
|
|
1688
|
+
{
|
|
1689
|
+
disabledDepth--;
|
|
1690
|
+
|
|
1691
|
+
if (disabledDepth === 0) {
|
|
1692
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
1693
|
+
var props = {
|
|
1694
|
+
configurable: true,
|
|
1695
|
+
enumerable: true,
|
|
1696
|
+
writable: true
|
|
1697
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1698
|
+
|
|
1699
|
+
Object.defineProperties(console, {
|
|
1700
|
+
log: _assign({}, props, {
|
|
1701
|
+
value: prevLog
|
|
1702
|
+
}),
|
|
1703
|
+
info: _assign({}, props, {
|
|
1704
|
+
value: prevInfo
|
|
1705
|
+
}),
|
|
1706
|
+
warn: _assign({}, props, {
|
|
1707
|
+
value: prevWarn
|
|
1708
|
+
}),
|
|
1709
|
+
error: _assign({}, props, {
|
|
1710
|
+
value: prevError
|
|
1711
|
+
}),
|
|
1712
|
+
group: _assign({}, props, {
|
|
1713
|
+
value: prevGroup
|
|
1714
|
+
}),
|
|
1715
|
+
groupCollapsed: _assign({}, props, {
|
|
1716
|
+
value: prevGroupCollapsed
|
|
1717
|
+
}),
|
|
1718
|
+
groupEnd: _assign({}, props, {
|
|
1719
|
+
value: prevGroupEnd
|
|
1720
|
+
})
|
|
1721
|
+
});
|
|
1722
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
if (disabledDepth < 0) {
|
|
1726
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1732
|
+
var prefix;
|
|
1733
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1734
|
+
{
|
|
1735
|
+
if (prefix === undefined) {
|
|
1736
|
+
// Extract the VM specific prefix used by each line.
|
|
1737
|
+
try {
|
|
1738
|
+
throw Error();
|
|
1739
|
+
} catch (x) {
|
|
1740
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1741
|
+
prefix = match && match[1] || '';
|
|
1742
|
+
}
|
|
1743
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
return '\n' + prefix + name;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
var reentry = false;
|
|
1750
|
+
var componentFrameCache;
|
|
1751
|
+
|
|
1752
|
+
{
|
|
1753
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1754
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
1758
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1759
|
+
if (!fn || reentry) {
|
|
1760
|
+
return '';
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
{
|
|
1764
|
+
var frame = componentFrameCache.get(fn);
|
|
1765
|
+
|
|
1766
|
+
if (frame !== undefined) {
|
|
1767
|
+
return frame;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
var control;
|
|
1772
|
+
reentry = true;
|
|
1773
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
1774
|
+
|
|
1775
|
+
Error.prepareStackTrace = undefined;
|
|
1776
|
+
var previousDispatcher;
|
|
1777
|
+
|
|
1778
|
+
{
|
|
1779
|
+
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
1780
|
+
// for warnings.
|
|
1781
|
+
|
|
1782
|
+
ReactCurrentDispatcher$1.current = null;
|
|
1783
|
+
disableLogs();
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
try {
|
|
1787
|
+
// This should throw.
|
|
1788
|
+
if (construct) {
|
|
1789
|
+
// Something should be setting the props in the constructor.
|
|
1790
|
+
var Fake = function () {
|
|
1791
|
+
throw Error();
|
|
1792
|
+
}; // $FlowFixMe
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
1796
|
+
set: function () {
|
|
1797
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
1798
|
+
// because that won't throw in a non-strict mode function.
|
|
1799
|
+
throw Error();
|
|
1800
|
+
}
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1804
|
+
// We construct a different control for this case to include any extra
|
|
1805
|
+
// frames added by the construct call.
|
|
1806
|
+
try {
|
|
1807
|
+
Reflect.construct(Fake, []);
|
|
1808
|
+
} catch (x) {
|
|
1809
|
+
control = x;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
Reflect.construct(fn, [], Fake);
|
|
1813
|
+
} else {
|
|
1814
|
+
try {
|
|
1815
|
+
Fake.call();
|
|
1816
|
+
} catch (x) {
|
|
1817
|
+
control = x;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
fn.call(Fake.prototype);
|
|
1821
|
+
}
|
|
1822
|
+
} else {
|
|
1823
|
+
try {
|
|
1824
|
+
throw Error();
|
|
1825
|
+
} catch (x) {
|
|
1826
|
+
control = x;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
fn();
|
|
1830
|
+
}
|
|
1831
|
+
} catch (sample) {
|
|
1832
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
1833
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
1834
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
1835
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
1836
|
+
var sampleLines = sample.stack.split('\n');
|
|
1837
|
+
var controlLines = control.stack.split('\n');
|
|
1838
|
+
var s = sampleLines.length - 1;
|
|
1839
|
+
var c = controlLines.length - 1;
|
|
1840
|
+
|
|
1841
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1842
|
+
// We expect at least one stack frame to be shared.
|
|
1843
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
1844
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
1845
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
1846
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
1847
|
+
// the sample somewhere in the control.
|
|
1848
|
+
c--;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1852
|
+
// Next we find the first one that isn't the same which should be the
|
|
1853
|
+
// frame that called our sample function and the control.
|
|
1854
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
1855
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
1856
|
+
// If we're about to return the first line, and the control is also on the same
|
|
1857
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
1858
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
1859
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
1860
|
+
if (s !== 1 || c !== 1) {
|
|
1861
|
+
do {
|
|
1862
|
+
s--;
|
|
1863
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
1864
|
+
// The next one that isn't the same should be our match though.
|
|
1865
|
+
|
|
1866
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1867
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1868
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1869
|
+
|
|
1870
|
+
{
|
|
1871
|
+
if (typeof fn === 'function') {
|
|
1872
|
+
componentFrameCache.set(fn, _frame);
|
|
1873
|
+
}
|
|
1874
|
+
} // Return the line we found.
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
return _frame;
|
|
1878
|
+
}
|
|
1879
|
+
} while (s >= 1 && c >= 0);
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
break;
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
} finally {
|
|
1887
|
+
reentry = false;
|
|
1888
|
+
|
|
1889
|
+
{
|
|
1890
|
+
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1891
|
+
reenableLogs();
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1895
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
1899
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
1900
|
+
|
|
1901
|
+
{
|
|
1902
|
+
if (typeof fn === 'function') {
|
|
1903
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
return syntheticFrame;
|
|
1908
|
+
}
|
|
1909
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1910
|
+
{
|
|
1911
|
+
return describeNativeComponentFrame(fn, false);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
function shouldConstruct(Component) {
|
|
1916
|
+
var prototype = Component.prototype;
|
|
1917
|
+
return !!(prototype && prototype.isReactComponent);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1921
|
+
|
|
1922
|
+
if (type == null) {
|
|
1923
|
+
return '';
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
if (typeof type === 'function') {
|
|
1927
|
+
{
|
|
1928
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
if (typeof type === 'string') {
|
|
1933
|
+
return describeBuiltInComponentFrame(type);
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
switch (type) {
|
|
1937
|
+
case exports.Suspense:
|
|
1938
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
1939
|
+
|
|
1940
|
+
case exports.unstable_SuspenseList:
|
|
1941
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
if (typeof type === 'object') {
|
|
1945
|
+
switch (type.$$typeof) {
|
|
1946
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1947
|
+
return describeFunctionComponentFrame(type.render);
|
|
1948
|
+
|
|
1949
|
+
case REACT_MEMO_TYPE:
|
|
1950
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
1951
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1952
|
+
|
|
1953
|
+
case REACT_BLOCK_TYPE:
|
|
1954
|
+
return describeFunctionComponentFrame(type._render);
|
|
1955
|
+
|
|
1956
|
+
case REACT_LAZY_TYPE:
|
|
1957
|
+
{
|
|
1958
|
+
var lazyComponent = type;
|
|
1959
|
+
var payload = lazyComponent._payload;
|
|
1960
|
+
var init = lazyComponent._init;
|
|
1961
|
+
|
|
1962
|
+
try {
|
|
1963
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
1964
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1965
|
+
} catch (x) {}
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
return '';
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1758
1973
|
var loggedTypeFailures = {};
|
|
1759
|
-
|
|
1974
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1975
|
+
|
|
1976
|
+
function setCurrentlyValidatingElement(element) {
|
|
1977
|
+
{
|
|
1978
|
+
if (element) {
|
|
1979
|
+
var owner = element._owner;
|
|
1980
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1981
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1982
|
+
} else {
|
|
1983
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1760
1989
|
{
|
|
1761
1990
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1762
1991
|
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
@@ -1782,21 +2011,40 @@ function checkPropTypes(typeSpecs, values, location, componentName) {
|
|
|
1782
2011
|
}
|
|
1783
2012
|
|
|
1784
2013
|
if (error$1 && !(error$1 instanceof Error)) {
|
|
2014
|
+
setCurrentlyValidatingElement(element);
|
|
2015
|
+
|
|
1785
2016
|
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);
|
|
2017
|
+
|
|
2018
|
+
setCurrentlyValidatingElement(null);
|
|
1786
2019
|
}
|
|
1787
2020
|
|
|
1788
2021
|
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1789
2022
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1790
2023
|
// same error.
|
|
1791
2024
|
loggedTypeFailures[error$1.message] = true;
|
|
2025
|
+
setCurrentlyValidatingElement(element);
|
|
1792
2026
|
|
|
1793
2027
|
error('Failed %s type: %s', location, error$1.message);
|
|
2028
|
+
|
|
2029
|
+
setCurrentlyValidatingElement(null);
|
|
1794
2030
|
}
|
|
1795
2031
|
}
|
|
1796
2032
|
}
|
|
1797
2033
|
}
|
|
1798
2034
|
}
|
|
1799
2035
|
|
|
2036
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
2037
|
+
{
|
|
2038
|
+
if (element) {
|
|
2039
|
+
var owner = element._owner;
|
|
2040
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2041
|
+
setExtraStackFrame(stack);
|
|
2042
|
+
} else {
|
|
2043
|
+
setExtraStackFrame(null);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
|
|
1800
2048
|
var propTypesMisspellWarningShown;
|
|
1801
2049
|
|
|
1802
2050
|
{
|
|
@@ -1890,13 +2138,13 @@ function validateExplicitKey(element, parentType) {
|
|
|
1890
2138
|
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
1891
2139
|
}
|
|
1892
2140
|
|
|
1893
|
-
setCurrentlyValidatingElement(element);
|
|
1894
|
-
|
|
1895
2141
|
{
|
|
2142
|
+
setCurrentlyValidatingElement$1(element);
|
|
2143
|
+
|
|
1896
2144
|
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1897
|
-
}
|
|
1898
2145
|
|
|
1899
|
-
|
|
2146
|
+
setCurrentlyValidatingElement$1(null);
|
|
2147
|
+
}
|
|
1900
2148
|
}
|
|
1901
2149
|
/**
|
|
1902
2150
|
* Ensure that every element either is passed in a static location, in an
|
|
@@ -1976,9 +2224,7 @@ function validatePropTypes(element) {
|
|
|
1976
2224
|
}
|
|
1977
2225
|
|
|
1978
2226
|
if (propTypes) {
|
|
1979
|
-
|
|
1980
|
-
checkPropTypes(propTypes, element.props, 'prop', name);
|
|
1981
|
-
setCurrentlyValidatingElement(null);
|
|
2227
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1982
2228
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1983
2229
|
propTypesMisspellWarningShown = true;
|
|
1984
2230
|
|
|
@@ -1998,24 +2244,28 @@ function validatePropTypes(element) {
|
|
|
1998
2244
|
|
|
1999
2245
|
function validateFragmentProps(fragment) {
|
|
2000
2246
|
{
|
|
2001
|
-
setCurrentlyValidatingElement(fragment);
|
|
2002
2247
|
var keys = Object.keys(fragment.props);
|
|
2003
2248
|
|
|
2004
2249
|
for (var i = 0; i < keys.length; i++) {
|
|
2005
2250
|
var key = keys[i];
|
|
2006
2251
|
|
|
2007
2252
|
if (key !== 'children' && key !== 'key') {
|
|
2253
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2254
|
+
|
|
2008
2255
|
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2009
2256
|
|
|
2257
|
+
setCurrentlyValidatingElement$1(null);
|
|
2010
2258
|
break;
|
|
2011
2259
|
}
|
|
2012
2260
|
}
|
|
2013
2261
|
|
|
2014
2262
|
if (fragment.ref !== null) {
|
|
2263
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
2264
|
+
|
|
2015
2265
|
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2016
|
-
}
|
|
2017
2266
|
|
|
2018
|
-
|
|
2267
|
+
setCurrentlyValidatingElement$1(null);
|
|
2268
|
+
}
|
|
2019
2269
|
}
|
|
2020
2270
|
}
|
|
2021
2271
|
function createElementWithValidation(type, props, children) {
|
|
@@ -2164,32 +2414,32 @@ exports.Children = Children;
|
|
|
2164
2414
|
exports.Component = Component;
|
|
2165
2415
|
exports.PureComponent = PureComponent;
|
|
2166
2416
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2167
|
-
exports.block = block;
|
|
2168
2417
|
exports.cloneElement = cloneElement$1;
|
|
2169
2418
|
exports.createContext = createContext;
|
|
2170
2419
|
exports.createElement = createElement$1;
|
|
2171
2420
|
exports.createFactory = createFactory;
|
|
2172
|
-
exports.createMutableSource = createMutableSource;
|
|
2173
2421
|
exports.createRef = createRef;
|
|
2174
2422
|
exports.forwardRef = forwardRef;
|
|
2175
2423
|
exports.isValidElement = isValidElement;
|
|
2176
2424
|
exports.lazy = lazy;
|
|
2177
2425
|
exports.memo = memo;
|
|
2426
|
+
exports.unstable_block = block;
|
|
2427
|
+
exports.unstable_createMutableSource = createMutableSource;
|
|
2428
|
+
exports.unstable_useDeferredValue = useDeferredValue;
|
|
2429
|
+
exports.unstable_useMutableSource = useMutableSource;
|
|
2178
2430
|
exports.unstable_useOpaqueIdentifier = useOpaqueIdentifier;
|
|
2431
|
+
exports.unstable_useTransition = useTransition;
|
|
2179
2432
|
exports.unstable_withSuspenseConfig = withSuspenseConfig;
|
|
2180
2433
|
exports.useCallback = useCallback;
|
|
2181
2434
|
exports.useContext = useContext;
|
|
2182
2435
|
exports.useDebugValue = useDebugValue;
|
|
2183
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2184
2436
|
exports.useEffect = useEffect;
|
|
2185
2437
|
exports.useImperativeHandle = useImperativeHandle;
|
|
2186
2438
|
exports.useLayoutEffect = useLayoutEffect;
|
|
2187
2439
|
exports.useMemo = useMemo;
|
|
2188
|
-
exports.useMutableSource = useMutableSource;
|
|
2189
2440
|
exports.useReducer = useReducer;
|
|
2190
2441
|
exports.useRef = useRef;
|
|
2191
2442
|
exports.useState = useState;
|
|
2192
|
-
exports.useTransition = useTransition;
|
|
2193
2443
|
exports.version = ReactVersion;
|
|
2194
2444
|
})();
|
|
2195
2445
|
}
|