react 16.11.0 → 16.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/.DS_Store +0 -0
- package/cjs/react-jsx-dev-runtime.development.js +889 -0
- package/cjs/react-jsx-dev-runtime.production.min.js +9 -0
- package/cjs/react-jsx-runtime.development.js +911 -0
- package/cjs/react-jsx-runtime.production.min.js +10 -0
- package/cjs/react.development.js +412 -818
- package/cjs/react.production.min.js +17 -17
- package/jsx-dev-runtime.js +7 -0
- package/jsx-runtime.js +7 -0
- package/package.json +29 -23
- package/umd/react.development.js +2605 -3199
- package/umd/react.production.min.js +25 -26
- package/umd/react.profiling.min.js +32 -33
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @license React v16.14.0
|
|
2
|
+
* react-jsx-runtime.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';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};
|
|
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;
|
package/cjs/react.development.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.14.0
|
|
2
2
|
* react.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -18,9 +18,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
19
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var ReactVersion = '16.11.0';
|
|
21
|
+
var ReactVersion = '16.14.0';
|
|
24
22
|
|
|
25
23
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
26
24
|
// nor polyfill, then a plain number is used for performance.
|
|
@@ -32,15 +30,13 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
32
30
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
33
31
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
34
32
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
35
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
36
|
-
|
|
37
|
-
|
|
38
33
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
39
34
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
40
35
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
41
36
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
42
37
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
43
38
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
39
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
44
40
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
45
41
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
46
42
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
@@ -60,113 +56,264 @@ function getIteratorFn(maybeIterable) {
|
|
|
60
56
|
return null;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Keeps track of the current dispatcher.
|
|
61
|
+
*/
|
|
62
|
+
var ReactCurrentDispatcher = {
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
* @type {ReactComponent}
|
|
66
|
+
*/
|
|
67
|
+
current: null
|
|
68
|
+
};
|
|
66
69
|
|
|
67
70
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
71
|
-
* to provide information about what broke and what you were
|
|
72
|
-
* expecting.
|
|
73
|
-
*
|
|
74
|
-
* The invariant message will be stripped in production, but the invariant
|
|
75
|
-
* will remain to ensure logic does not differ in production.
|
|
71
|
+
* Keeps track of the current batch's configuration such as how long an update
|
|
72
|
+
* should suspend for if it needs to.
|
|
76
73
|
*/
|
|
74
|
+
var ReactCurrentBatchConfig = {
|
|
75
|
+
suspense: null
|
|
76
|
+
};
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
80
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
79
|
+
* Keeps track of the current owner.
|
|
81
80
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* This really simplifies the code.
|
|
85
|
-
* ---
|
|
86
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
87
|
-
* This can be used to log issues in development environments in critical
|
|
88
|
-
* paths. Removing the logging code for production environments will keep the
|
|
89
|
-
* same logic and follow the same code paths.
|
|
81
|
+
* The current owner is the component who should own any components that are
|
|
82
|
+
* currently being constructed.
|
|
90
83
|
*/
|
|
91
|
-
var
|
|
84
|
+
var ReactCurrentOwner = {
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
* @type {ReactComponent}
|
|
88
|
+
*/
|
|
89
|
+
current: null
|
|
90
|
+
};
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
93
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
94
|
+
var sourceInfo = '';
|
|
95
|
+
|
|
96
|
+
if (source) {
|
|
97
|
+
var path = source.fileName;
|
|
98
|
+
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
// In DEV, include code for a common special case:
|
|
102
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
103
|
+
if (/^index\./.test(fileName)) {
|
|
104
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
105
|
+
|
|
106
|
+
if (match) {
|
|
107
|
+
var pathBeforeSlash = match[1];
|
|
108
|
+
|
|
109
|
+
if (pathBeforeSlash) {
|
|
110
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
111
|
+
fileName = folderName + '/' + fileName;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
97
115
|
}
|
|
98
116
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
118
|
+
} else if (ownerName) {
|
|
119
|
+
sourceInfo = ' (created by ' + ownerName + ')';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
var Resolved = 1;
|
|
126
|
+
function refineResolvedLazyComponent(lazyComponent) {
|
|
127
|
+
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
131
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
132
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function getComponentName(type) {
|
|
136
|
+
if (type == null) {
|
|
137
|
+
// Host root, text node or just invalid type.
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
103
140
|
|
|
104
|
-
|
|
105
|
-
|
|
141
|
+
{
|
|
142
|
+
if (typeof type.tag === 'number') {
|
|
143
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
106
144
|
}
|
|
145
|
+
}
|
|
107
146
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// to find the callsite that caused this warning to fire.
|
|
112
|
-
throw new Error(message);
|
|
113
|
-
} catch (x) {}
|
|
114
|
-
};
|
|
147
|
+
if (typeof type === 'function') {
|
|
148
|
+
return type.displayName || type.name || null;
|
|
149
|
+
}
|
|
115
150
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
151
|
+
if (typeof type === 'string') {
|
|
152
|
+
return type;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
switch (type) {
|
|
156
|
+
case REACT_FRAGMENT_TYPE:
|
|
157
|
+
return 'Fragment';
|
|
158
|
+
|
|
159
|
+
case REACT_PORTAL_TYPE:
|
|
160
|
+
return 'Portal';
|
|
161
|
+
|
|
162
|
+
case REACT_PROFILER_TYPE:
|
|
163
|
+
return "Profiler";
|
|
164
|
+
|
|
165
|
+
case REACT_STRICT_MODE_TYPE:
|
|
166
|
+
return 'StrictMode';
|
|
167
|
+
|
|
168
|
+
case REACT_SUSPENSE_TYPE:
|
|
169
|
+
return 'Suspense';
|
|
170
|
+
|
|
171
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
172
|
+
return 'SuspenseList';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (typeof type === 'object') {
|
|
176
|
+
switch (type.$$typeof) {
|
|
177
|
+
case REACT_CONTEXT_TYPE:
|
|
178
|
+
return 'Context.Consumer';
|
|
179
|
+
|
|
180
|
+
case REACT_PROVIDER_TYPE:
|
|
181
|
+
return 'Context.Provider';
|
|
182
|
+
|
|
183
|
+
case REACT_FORWARD_REF_TYPE:
|
|
184
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
185
|
+
|
|
186
|
+
case REACT_MEMO_TYPE:
|
|
187
|
+
return getComponentName(type.type);
|
|
188
|
+
|
|
189
|
+
case REACT_BLOCK_TYPE:
|
|
190
|
+
return getComponentName(type.render);
|
|
191
|
+
|
|
192
|
+
case REACT_LAZY_TYPE:
|
|
193
|
+
{
|
|
194
|
+
var thenable = type;
|
|
195
|
+
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
196
|
+
|
|
197
|
+
if (resolvedThenable) {
|
|
198
|
+
return getComponentName(resolvedThenable);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
119
203
|
}
|
|
204
|
+
}
|
|
120
205
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var ReactDebugCurrentFrame = {};
|
|
210
|
+
var currentlyValidatingElement = null;
|
|
211
|
+
function setCurrentlyValidatingElement(element) {
|
|
212
|
+
{
|
|
213
|
+
currentlyValidatingElement = element;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
{
|
|
218
|
+
// Stack implementation injected by the current renderer.
|
|
219
|
+
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
220
|
+
|
|
221
|
+
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
222
|
+
var stack = ''; // Add an extra top frame while an element is being validated
|
|
223
|
+
|
|
224
|
+
if (currentlyValidatingElement) {
|
|
225
|
+
var name = getComponentName(currentlyValidatingElement.type);
|
|
226
|
+
var owner = currentlyValidatingElement._owner;
|
|
227
|
+
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
228
|
+
} // Delegate to the injected renderer-specific implementation
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
125
232
|
|
|
126
|
-
|
|
233
|
+
if (impl) {
|
|
234
|
+
stack += impl() || '';
|
|
127
235
|
}
|
|
236
|
+
|
|
237
|
+
return stack;
|
|
128
238
|
};
|
|
129
239
|
}
|
|
130
240
|
|
|
131
|
-
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
132
|
-
|
|
133
241
|
/**
|
|
134
|
-
*
|
|
135
|
-
* This can be used to log issues in development environments in critical
|
|
136
|
-
* paths. Removing the logging code for production environments will keep the
|
|
137
|
-
* same logic and follow the same code paths.
|
|
242
|
+
* Used by act() to track whether you're inside an act() scope.
|
|
138
243
|
*/
|
|
139
|
-
var
|
|
244
|
+
var IsSomeRendererActing = {
|
|
245
|
+
current: false
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
var ReactSharedInternals = {
|
|
249
|
+
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
250
|
+
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
251
|
+
ReactCurrentOwner: ReactCurrentOwner,
|
|
252
|
+
IsSomeRendererActing: IsSomeRendererActing,
|
|
253
|
+
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
254
|
+
assign: _assign
|
|
255
|
+
};
|
|
140
256
|
|
|
141
257
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
258
|
+
_assign(ReactSharedInternals, {
|
|
259
|
+
// These should not be included in production.
|
|
260
|
+
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
261
|
+
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
262
|
+
// TODO: remove in React 17.0.
|
|
263
|
+
ReactComponentTreeHook: {}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
146
266
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
267
|
+
// by calls to these methods by a Babel plugin.
|
|
268
|
+
//
|
|
269
|
+
// In PROD (or in packages without access to React internals),
|
|
270
|
+
// they are left as they are instead.
|
|
150
271
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
272
|
+
function warn(format) {
|
|
273
|
+
{
|
|
274
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
275
|
+
args[_key - 1] = arguments[_key];
|
|
154
276
|
}
|
|
155
277
|
|
|
156
|
-
|
|
157
|
-
|
|
278
|
+
printWarning('warn', format, args);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function error(format) {
|
|
282
|
+
{
|
|
283
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
284
|
+
args[_key2 - 1] = arguments[_key2];
|
|
158
285
|
}
|
|
159
286
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
});
|
|
164
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
165
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
287
|
+
printWarning('error', format, args);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
166
290
|
|
|
167
|
-
|
|
291
|
+
function printWarning(level, format, args) {
|
|
292
|
+
// When changing this logic, you might want to also
|
|
293
|
+
// update consoleWithStackDev.www.js as well.
|
|
294
|
+
{
|
|
295
|
+
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
|
|
296
|
+
|
|
297
|
+
if (!hasExistingStack) {
|
|
298
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
299
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
300
|
+
|
|
301
|
+
if (stack !== '') {
|
|
302
|
+
format += '%s';
|
|
303
|
+
args = args.concat([stack]);
|
|
304
|
+
}
|
|
168
305
|
}
|
|
169
306
|
|
|
307
|
+
var argsWithFormat = args.map(function (item) {
|
|
308
|
+
return '' + item;
|
|
309
|
+
}); // Careful: RN currently depends on this prefix
|
|
310
|
+
|
|
311
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
312
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
313
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
314
|
+
|
|
315
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
316
|
+
|
|
170
317
|
try {
|
|
171
318
|
// --- Welcome to debugging React ---
|
|
172
319
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -177,11 +324,9 @@ var warningWithoutStack = function () {};
|
|
|
177
324
|
});
|
|
178
325
|
throw new Error(message);
|
|
179
326
|
} catch (x) {}
|
|
180
|
-
}
|
|
327
|
+
}
|
|
181
328
|
}
|
|
182
329
|
|
|
183
|
-
var warningWithoutStack$1 = warningWithoutStack;
|
|
184
|
-
|
|
185
330
|
var didWarnStateUpdateForUnmountedComponent = {};
|
|
186
331
|
|
|
187
332
|
function warnNoop(publicInstance, callerName) {
|
|
@@ -194,7 +339,8 @@ function warnNoop(publicInstance, callerName) {
|
|
|
194
339
|
return;
|
|
195
340
|
}
|
|
196
341
|
|
|
197
|
-
|
|
342
|
+
error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
343
|
+
|
|
198
344
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
199
345
|
}
|
|
200
346
|
}
|
|
@@ -318,7 +464,7 @@ Component.prototype.isReactComponent = {};
|
|
|
318
464
|
Component.prototype.setState = function (partialState, callback) {
|
|
319
465
|
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
320
466
|
{
|
|
321
|
-
throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
467
|
+
throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
|
322
468
|
}
|
|
323
469
|
}
|
|
324
470
|
|
|
@@ -359,7 +505,8 @@ Component.prototype.forceUpdate = function (callback) {
|
|
|
359
505
|
var defineDeprecationWarning = function (methodName, info) {
|
|
360
506
|
Object.defineProperty(Component.prototype, methodName, {
|
|
361
507
|
get: function () {
|
|
362
|
-
|
|
508
|
+
warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
509
|
+
|
|
363
510
|
return undefined;
|
|
364
511
|
}
|
|
365
512
|
});
|
|
@@ -397,250 +544,16 @@ pureComponentPrototype.isPureReactComponent = true;
|
|
|
397
544
|
// an immutable object with a single mutable value
|
|
398
545
|
function createRef() {
|
|
399
546
|
var refObject = {
|
|
400
|
-
current: null
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
{
|
|
404
|
-
Object.seal(refObject);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
return refObject;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Keeps track of the current dispatcher.
|
|
412
|
-
*/
|
|
413
|
-
var ReactCurrentDispatcher = {
|
|
414
|
-
/**
|
|
415
|
-
* @internal
|
|
416
|
-
* @type {ReactComponent}
|
|
417
|
-
*/
|
|
418
|
-
current: null
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Keeps track of the current batch's configuration such as how long an update
|
|
423
|
-
* should suspend for if it needs to.
|
|
424
|
-
*/
|
|
425
|
-
var ReactCurrentBatchConfig = {
|
|
426
|
-
suspense: null
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Keeps track of the current owner.
|
|
431
|
-
*
|
|
432
|
-
* The current owner is the component who should own any components that are
|
|
433
|
-
* currently being constructed.
|
|
434
|
-
*/
|
|
435
|
-
var ReactCurrentOwner = {
|
|
436
|
-
/**
|
|
437
|
-
* @internal
|
|
438
|
-
* @type {ReactComponent}
|
|
439
|
-
*/
|
|
440
|
-
current: null
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
444
|
-
var describeComponentFrame = function (name, source, ownerName) {
|
|
445
|
-
var sourceInfo = '';
|
|
446
|
-
|
|
447
|
-
if (source) {
|
|
448
|
-
var path = source.fileName;
|
|
449
|
-
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
450
|
-
|
|
451
|
-
{
|
|
452
|
-
// In DEV, include code for a common special case:
|
|
453
|
-
// prefer "folder/index.js" instead of just "index.js".
|
|
454
|
-
if (/^index\./.test(fileName)) {
|
|
455
|
-
var match = path.match(BEFORE_SLASH_RE);
|
|
456
|
-
|
|
457
|
-
if (match) {
|
|
458
|
-
var pathBeforeSlash = match[1];
|
|
459
|
-
|
|
460
|
-
if (pathBeforeSlash) {
|
|
461
|
-
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
462
|
-
fileName = folderName + '/' + fileName;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
469
|
-
} else if (ownerName) {
|
|
470
|
-
sourceInfo = ' (created by ' + ownerName + ')';
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
var Resolved = 1;
|
|
477
|
-
|
|
478
|
-
function refineResolvedLazyComponent(lazyComponent) {
|
|
479
|
-
return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
483
|
-
var functionName = innerType.displayName || innerType.name || '';
|
|
484
|
-
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
function getComponentName(type) {
|
|
488
|
-
if (type == null) {
|
|
489
|
-
// Host root, text node or just invalid type.
|
|
490
|
-
return null;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
{
|
|
494
|
-
if (typeof type.tag === 'number') {
|
|
495
|
-
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
if (typeof type === 'function') {
|
|
500
|
-
return type.displayName || type.name || null;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
if (typeof type === 'string') {
|
|
504
|
-
return type;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
switch (type) {
|
|
508
|
-
case REACT_FRAGMENT_TYPE:
|
|
509
|
-
return 'Fragment';
|
|
510
|
-
|
|
511
|
-
case REACT_PORTAL_TYPE:
|
|
512
|
-
return 'Portal';
|
|
513
|
-
|
|
514
|
-
case REACT_PROFILER_TYPE:
|
|
515
|
-
return "Profiler";
|
|
516
|
-
|
|
517
|
-
case REACT_STRICT_MODE_TYPE:
|
|
518
|
-
return 'StrictMode';
|
|
519
|
-
|
|
520
|
-
case REACT_SUSPENSE_TYPE:
|
|
521
|
-
return 'Suspense';
|
|
522
|
-
|
|
523
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
524
|
-
return 'SuspenseList';
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
if (typeof type === 'object') {
|
|
528
|
-
switch (type.$$typeof) {
|
|
529
|
-
case REACT_CONTEXT_TYPE:
|
|
530
|
-
return 'Context.Consumer';
|
|
531
|
-
|
|
532
|
-
case REACT_PROVIDER_TYPE:
|
|
533
|
-
return '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_LAZY_TYPE:
|
|
542
|
-
{
|
|
543
|
-
var thenable = type;
|
|
544
|
-
var resolvedThenable = refineResolvedLazyComponent(thenable);
|
|
545
|
-
|
|
546
|
-
if (resolvedThenable) {
|
|
547
|
-
return getComponentName(resolvedThenable);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
break;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
return null;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
var ReactDebugCurrentFrame = {};
|
|
559
|
-
var currentlyValidatingElement = null;
|
|
560
|
-
function setCurrentlyValidatingElement(element) {
|
|
561
|
-
{
|
|
562
|
-
currentlyValidatingElement = element;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
{
|
|
567
|
-
// Stack implementation injected by the current renderer.
|
|
568
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
569
|
-
|
|
570
|
-
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
571
|
-
var stack = ''; // Add an extra top frame while an element is being validated
|
|
572
|
-
|
|
573
|
-
if (currentlyValidatingElement) {
|
|
574
|
-
var name = getComponentName(currentlyValidatingElement.type);
|
|
575
|
-
var owner = currentlyValidatingElement._owner;
|
|
576
|
-
stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
|
577
|
-
} // Delegate to the injected renderer-specific implementation
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
581
|
-
|
|
582
|
-
if (impl) {
|
|
583
|
-
stack += impl() || '';
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
return stack;
|
|
587
|
-
};
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Used by act() to track whether you're inside an act() scope.
|
|
592
|
-
*/
|
|
593
|
-
var IsSomeRendererActing = {
|
|
594
|
-
current: false
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
var ReactSharedInternals = {
|
|
598
|
-
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
599
|
-
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
600
|
-
ReactCurrentOwner: ReactCurrentOwner,
|
|
601
|
-
IsSomeRendererActing: IsSomeRendererActing,
|
|
602
|
-
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
603
|
-
assign: _assign
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
{
|
|
607
|
-
_assign(ReactSharedInternals, {
|
|
608
|
-
// These should not be included in production.
|
|
609
|
-
ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
|
610
|
-
// Shim for React DOM 16.0.0 which still destructured (but not used) this.
|
|
611
|
-
// TODO: remove in React 17.0.
|
|
612
|
-
ReactComponentTreeHook: {}
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
618
|
-
* This can be used to log issues in development environments in critical
|
|
619
|
-
* paths. Removing the logging code for production environments will keep the
|
|
620
|
-
* same logic and follow the same code paths.
|
|
621
|
-
*/
|
|
622
|
-
|
|
623
|
-
var warning = warningWithoutStack$1;
|
|
624
|
-
|
|
625
|
-
{
|
|
626
|
-
warning = function (condition, format) {
|
|
627
|
-
if (condition) {
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
632
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
547
|
+
current: null
|
|
548
|
+
};
|
|
633
549
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
550
|
+
{
|
|
551
|
+
Object.seal(refObject);
|
|
552
|
+
}
|
|
637
553
|
|
|
638
|
-
|
|
639
|
-
};
|
|
554
|
+
return refObject;
|
|
640
555
|
}
|
|
641
556
|
|
|
642
|
-
var warning$1 = warning;
|
|
643
|
-
|
|
644
557
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
645
558
|
var RESERVED_PROPS = {
|
|
646
559
|
key: true,
|
|
@@ -648,8 +561,11 @@ var RESERVED_PROPS = {
|
|
|
648
561
|
__self: true,
|
|
649
562
|
__source: true
|
|
650
563
|
};
|
|
651
|
-
var specialPropKeyWarningShown;
|
|
652
|
-
|
|
564
|
+
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
565
|
+
|
|
566
|
+
{
|
|
567
|
+
didWarnAboutStringRefs = {};
|
|
568
|
+
}
|
|
653
569
|
|
|
654
570
|
function hasValidRef(config) {
|
|
655
571
|
{
|
|
@@ -681,9 +597,12 @@ function hasValidKey(config) {
|
|
|
681
597
|
|
|
682
598
|
function defineKeyPropWarningGetter(props, displayName) {
|
|
683
599
|
var warnAboutAccessingKey = function () {
|
|
684
|
-
|
|
685
|
-
specialPropKeyWarningShown
|
|
686
|
-
|
|
600
|
+
{
|
|
601
|
+
if (!specialPropKeyWarningShown) {
|
|
602
|
+
specialPropKeyWarningShown = true;
|
|
603
|
+
|
|
604
|
+
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://fb.me/react-special-props)', displayName);
|
|
605
|
+
}
|
|
687
606
|
}
|
|
688
607
|
};
|
|
689
608
|
|
|
@@ -696,9 +615,12 @@ function defineKeyPropWarningGetter(props, displayName) {
|
|
|
696
615
|
|
|
697
616
|
function defineRefPropWarningGetter(props, displayName) {
|
|
698
617
|
var warnAboutAccessingRef = function () {
|
|
699
|
-
|
|
700
|
-
specialPropRefWarningShown
|
|
701
|
-
|
|
618
|
+
{
|
|
619
|
+
if (!specialPropRefWarningShown) {
|
|
620
|
+
specialPropRefWarningShown = true;
|
|
621
|
+
|
|
622
|
+
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://fb.me/react-special-props)', displayName);
|
|
623
|
+
}
|
|
702
624
|
}
|
|
703
625
|
};
|
|
704
626
|
|
|
@@ -708,6 +630,20 @@ function defineRefPropWarningGetter(props, displayName) {
|
|
|
708
630
|
configurable: true
|
|
709
631
|
});
|
|
710
632
|
}
|
|
633
|
+
|
|
634
|
+
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
635
|
+
{
|
|
636
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
637
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
638
|
+
|
|
639
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
640
|
+
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://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
|
|
641
|
+
|
|
642
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
711
647
|
/**
|
|
712
648
|
* Factory method to create a new React element. This no longer adheres to
|
|
713
649
|
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
@@ -783,78 +719,6 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
783
719
|
|
|
784
720
|
return element;
|
|
785
721
|
};
|
|
786
|
-
/**
|
|
787
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
788
|
-
* @param {*} type
|
|
789
|
-
* @param {object} props
|
|
790
|
-
* @param {string} key
|
|
791
|
-
*/
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* https://github.com/reactjs/rfcs/pull/107
|
|
797
|
-
* @param {*} type
|
|
798
|
-
* @param {object} props
|
|
799
|
-
* @param {string} key
|
|
800
|
-
*/
|
|
801
|
-
|
|
802
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
803
|
-
var propName; // Reserved names are extracted
|
|
804
|
-
|
|
805
|
-
var props = {};
|
|
806
|
-
var key = null;
|
|
807
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
808
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
809
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
810
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
811
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
812
|
-
// key is explicitly declared to be undefined or not.
|
|
813
|
-
|
|
814
|
-
if (maybeKey !== undefined) {
|
|
815
|
-
key = '' + maybeKey;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
if (hasValidKey(config)) {
|
|
819
|
-
key = '' + config.key;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
if (hasValidRef(config)) {
|
|
823
|
-
ref = config.ref;
|
|
824
|
-
} // Remaining properties are added to a new props object
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
for (propName in config) {
|
|
828
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
829
|
-
props[propName] = config[propName];
|
|
830
|
-
}
|
|
831
|
-
} // Resolve default props
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
if (type && type.defaultProps) {
|
|
835
|
-
var defaultProps = type.defaultProps;
|
|
836
|
-
|
|
837
|
-
for (propName in defaultProps) {
|
|
838
|
-
if (props[propName] === undefined) {
|
|
839
|
-
props[propName] = defaultProps[propName];
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
if (key || ref) {
|
|
845
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
846
|
-
|
|
847
|
-
if (key) {
|
|
848
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
if (ref) {
|
|
852
|
-
defineRefPropWarningGetter(props, displayName);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
857
|
-
}
|
|
858
722
|
/**
|
|
859
723
|
* Create and return a new ReactElement of the given type.
|
|
860
724
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
@@ -872,6 +736,10 @@ function createElement(type, config, children) {
|
|
|
872
736
|
if (config != null) {
|
|
873
737
|
if (hasValidRef(config)) {
|
|
874
738
|
ref = config.ref;
|
|
739
|
+
|
|
740
|
+
{
|
|
741
|
+
warnIfStringRefCannotBeAutoConverted(config);
|
|
742
|
+
}
|
|
875
743
|
}
|
|
876
744
|
|
|
877
745
|
if (hasValidKey(config)) {
|
|
@@ -937,12 +805,6 @@ function createElement(type, config, children) {
|
|
|
937
805
|
|
|
938
806
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
939
807
|
}
|
|
940
|
-
/**
|
|
941
|
-
* Return a function that produces ReactElements of a given type.
|
|
942
|
-
* See https://reactjs.org/docs/react-api.html#createfactory
|
|
943
|
-
*/
|
|
944
|
-
|
|
945
|
-
|
|
946
808
|
function cloneAndReplaceKey(oldElement, newKey) {
|
|
947
809
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
948
810
|
return newElement;
|
|
@@ -955,7 +817,7 @@ function cloneAndReplaceKey(oldElement, newKey) {
|
|
|
955
817
|
function cloneElement(element, config, children) {
|
|
956
818
|
if (!!(element === null || element === undefined)) {
|
|
957
819
|
{
|
|
958
|
-
throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
|
820
|
+
throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
|
959
821
|
}
|
|
960
822
|
}
|
|
961
823
|
|
|
@@ -1164,10 +1026,14 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1164
1026
|
var iteratorFn = getIteratorFn(children);
|
|
1165
1027
|
|
|
1166
1028
|
if (typeof iteratorFn === 'function') {
|
|
1029
|
+
|
|
1167
1030
|
{
|
|
1168
1031
|
// Warn about using Maps as children
|
|
1169
1032
|
if (iteratorFn === children.entries) {
|
|
1170
|
-
!didWarnAboutMaps
|
|
1033
|
+
if (!didWarnAboutMaps) {
|
|
1034
|
+
warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.');
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1171
1037
|
didWarnAboutMaps = true;
|
|
1172
1038
|
}
|
|
1173
1039
|
}
|
|
@@ -1192,7 +1058,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
|
|
|
1192
1058
|
|
|
1193
1059
|
{
|
|
1194
1060
|
{
|
|
1195
|
-
throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
|
|
1061
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum );
|
|
1196
1062
|
}
|
|
1197
1063
|
}
|
|
1198
1064
|
}
|
|
@@ -1382,7 +1248,7 @@ function toArray(children) {
|
|
|
1382
1248
|
function onlyChild(children) {
|
|
1383
1249
|
if (!isValidElement(children)) {
|
|
1384
1250
|
{
|
|
1385
|
-
throw Error("React.Children.only expected to receive a single React element child.");
|
|
1251
|
+
throw Error( "React.Children.only expected to receive a single React element child." );
|
|
1386
1252
|
}
|
|
1387
1253
|
}
|
|
1388
1254
|
|
|
@@ -1394,7 +1260,9 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1394
1260
|
calculateChangedBits = null;
|
|
1395
1261
|
} else {
|
|
1396
1262
|
{
|
|
1397
|
-
|
|
1263
|
+
if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
|
1264
|
+
error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1265
|
+
}
|
|
1398
1266
|
}
|
|
1399
1267
|
}
|
|
1400
1268
|
|
|
@@ -1437,7 +1305,8 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1437
1305
|
get: function () {
|
|
1438
1306
|
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
1439
1307
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
1440
|
-
|
|
1308
|
+
|
|
1309
|
+
error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
1441
1310
|
}
|
|
1442
1311
|
|
|
1443
1312
|
return context.Provider;
|
|
@@ -1474,7 +1343,8 @@ function createContext(defaultValue, calculateChangedBits) {
|
|
|
1474
1343
|
get: function () {
|
|
1475
1344
|
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
1476
1345
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1477
|
-
|
|
1346
|
+
|
|
1347
|
+
error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
1478
1348
|
}
|
|
1479
1349
|
|
|
1480
1350
|
return context.Consumer;
|
|
@@ -1513,7 +1383,8 @@ function lazy(ctor) {
|
|
|
1513
1383
|
return defaultProps;
|
|
1514
1384
|
},
|
|
1515
1385
|
set: function (newDefaultProps) {
|
|
1516
|
-
|
|
1386
|
+
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.');
|
|
1387
|
+
|
|
1517
1388
|
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1518
1389
|
|
|
1519
1390
|
Object.defineProperty(lazyType, 'defaultProps', {
|
|
@@ -1527,7 +1398,8 @@ function lazy(ctor) {
|
|
|
1527
1398
|
return propTypes;
|
|
1528
1399
|
},
|
|
1529
1400
|
set: function (newPropTypes) {
|
|
1530
|
-
|
|
1401
|
+
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.');
|
|
1402
|
+
|
|
1531
1403
|
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1532
1404
|
|
|
1533
1405
|
Object.defineProperty(lazyType, 'propTypes', {
|
|
@@ -1544,16 +1416,19 @@ function lazy(ctor) {
|
|
|
1544
1416
|
function forwardRef(render) {
|
|
1545
1417
|
{
|
|
1546
1418
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1547
|
-
|
|
1419
|
+
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
1548
1420
|
} else if (typeof render !== 'function') {
|
|
1549
|
-
|
|
1421
|
+
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1550
1422
|
} else {
|
|
1551
|
-
|
|
1552
|
-
|
|
1423
|
+
if (render.length !== 0 && render.length !== 2) {
|
|
1424
|
+
error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
|
|
1425
|
+
}
|
|
1553
1426
|
}
|
|
1554
1427
|
|
|
1555
1428
|
if (render != null) {
|
|
1556
|
-
|
|
1429
|
+
if (render.defaultProps != null || render.propTypes != null) {
|
|
1430
|
+
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1431
|
+
}
|
|
1557
1432
|
}
|
|
1558
1433
|
}
|
|
1559
1434
|
|
|
@@ -1565,13 +1440,13 @@ function forwardRef(render) {
|
|
|
1565
1440
|
|
|
1566
1441
|
function isValidElementType(type) {
|
|
1567
1442
|
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1568
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
|
1443
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1569
1444
|
}
|
|
1570
1445
|
|
|
1571
1446
|
function memo(type, compare) {
|
|
1572
1447
|
{
|
|
1573
1448
|
if (!isValidElementType(type)) {
|
|
1574
|
-
|
|
1449
|
+
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1575
1450
|
}
|
|
1576
1451
|
}
|
|
1577
1452
|
|
|
@@ -1587,7 +1462,7 @@ function resolveDispatcher() {
|
|
|
1587
1462
|
|
|
1588
1463
|
if (!(dispatcher !== null)) {
|
|
1589
1464
|
{
|
|
1590
|
-
throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
|
|
1465
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1591
1466
|
}
|
|
1592
1467
|
}
|
|
1593
1468
|
|
|
@@ -1598,16 +1473,19 @@ function useContext(Context, unstable_observedBits) {
|
|
|
1598
1473
|
var dispatcher = resolveDispatcher();
|
|
1599
1474
|
|
|
1600
1475
|
{
|
|
1601
|
-
|
|
1476
|
+
if (unstable_observedBits !== undefined) {
|
|
1477
|
+
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://fb.me/rules-of-hooks' : '');
|
|
1478
|
+
} // TODO: add a more generic warning for invalid values.
|
|
1479
|
+
|
|
1602
1480
|
|
|
1603
1481
|
if (Context._context !== undefined) {
|
|
1604
1482
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1605
1483
|
// and nobody should be using this in existing code.
|
|
1606
1484
|
|
|
1607
1485
|
if (realContext.Consumer === Context) {
|
|
1608
|
-
|
|
1486
|
+
error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
1609
1487
|
} else if (realContext.Provider === Context) {
|
|
1610
|
-
|
|
1488
|
+
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
1611
1489
|
}
|
|
1612
1490
|
}
|
|
1613
1491
|
}
|
|
@@ -1626,25 +1504,25 @@ function useRef(initialValue) {
|
|
|
1626
1504
|
var dispatcher = resolveDispatcher();
|
|
1627
1505
|
return dispatcher.useRef(initialValue);
|
|
1628
1506
|
}
|
|
1629
|
-
function useEffect(create,
|
|
1507
|
+
function useEffect(create, deps) {
|
|
1630
1508
|
var dispatcher = resolveDispatcher();
|
|
1631
|
-
return dispatcher.useEffect(create,
|
|
1509
|
+
return dispatcher.useEffect(create, deps);
|
|
1632
1510
|
}
|
|
1633
|
-
function useLayoutEffect(create,
|
|
1511
|
+
function useLayoutEffect(create, deps) {
|
|
1634
1512
|
var dispatcher = resolveDispatcher();
|
|
1635
|
-
return dispatcher.useLayoutEffect(create,
|
|
1513
|
+
return dispatcher.useLayoutEffect(create, deps);
|
|
1636
1514
|
}
|
|
1637
|
-
function useCallback(callback,
|
|
1515
|
+
function useCallback(callback, deps) {
|
|
1638
1516
|
var dispatcher = resolveDispatcher();
|
|
1639
|
-
return dispatcher.useCallback(callback,
|
|
1517
|
+
return dispatcher.useCallback(callback, deps);
|
|
1640
1518
|
}
|
|
1641
|
-
function useMemo(create,
|
|
1519
|
+
function useMemo(create, deps) {
|
|
1642
1520
|
var dispatcher = resolveDispatcher();
|
|
1643
|
-
return dispatcher.useMemo(create,
|
|
1521
|
+
return dispatcher.useMemo(create, deps);
|
|
1644
1522
|
}
|
|
1645
|
-
function useImperativeHandle(ref, create,
|
|
1523
|
+
function useImperativeHandle(ref, create, deps) {
|
|
1646
1524
|
var dispatcher = resolveDispatcher();
|
|
1647
|
-
return dispatcher.useImperativeHandle(ref, create,
|
|
1525
|
+
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1648
1526
|
}
|
|
1649
1527
|
function useDebugValue(value, formatterFn) {
|
|
1650
1528
|
{
|
|
@@ -1652,53 +1530,13 @@ function useDebugValue(value, formatterFn) {
|
|
|
1652
1530
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1653
1531
|
}
|
|
1654
1532
|
}
|
|
1655
|
-
var emptyObject$1 = {};
|
|
1656
|
-
function useResponder(responder, listenerProps) {
|
|
1657
|
-
var dispatcher = resolveDispatcher();
|
|
1658
|
-
|
|
1659
|
-
{
|
|
1660
|
-
if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
|
|
1661
|
-
warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
|
|
1662
|
-
return;
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
|
|
1667
|
-
}
|
|
1668
|
-
function useTransition(config) {
|
|
1669
|
-
var dispatcher = resolveDispatcher();
|
|
1670
|
-
return dispatcher.useTransition(config);
|
|
1671
|
-
}
|
|
1672
|
-
function useDeferredValue(value, config) {
|
|
1673
|
-
var dispatcher = resolveDispatcher();
|
|
1674
|
-
return dispatcher.useDeferredValue(value, config);
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
function withSuspenseConfig(scope, config) {
|
|
1678
|
-
var previousConfig = ReactCurrentBatchConfig.suspense;
|
|
1679
|
-
ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
|
|
1680
|
-
|
|
1681
|
-
try {
|
|
1682
|
-
scope();
|
|
1683
|
-
} finally {
|
|
1684
|
-
ReactCurrentBatchConfig.suspense = previousConfig;
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
1533
|
|
|
1688
|
-
/**
|
|
1689
|
-
* ReactElementValidator provides a wrapper around a element factory
|
|
1690
|
-
* which validates the props passed to the element. This is intended to be
|
|
1691
|
-
* used only in DEV and could be replaced by a static type checker for languages
|
|
1692
|
-
* that support it.
|
|
1693
|
-
*/
|
|
1694
1534
|
var propTypesMisspellWarningShown;
|
|
1695
1535
|
|
|
1696
1536
|
{
|
|
1697
1537
|
propTypesMisspellWarningShown = false;
|
|
1698
1538
|
}
|
|
1699
1539
|
|
|
1700
|
-
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1701
|
-
|
|
1702
1540
|
function getDeclarationErrorAddendum() {
|
|
1703
1541
|
if (ReactCurrentOwner.current) {
|
|
1704
1542
|
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
@@ -1789,7 +1627,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
1789
1627
|
setCurrentlyValidatingElement(element);
|
|
1790
1628
|
|
|
1791
1629
|
{
|
|
1792
|
-
|
|
1630
|
+
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);
|
|
1793
1631
|
}
|
|
1794
1632
|
|
|
1795
1633
|
setCurrentlyValidatingElement(null);
|
|
@@ -1851,36 +1689,39 @@ function validateChildKeys(node, parentType) {
|
|
|
1851
1689
|
|
|
1852
1690
|
|
|
1853
1691
|
function validatePropTypes(element) {
|
|
1854
|
-
|
|
1692
|
+
{
|
|
1693
|
+
var type = element.type;
|
|
1855
1694
|
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1695
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1859
1698
|
|
|
1860
|
-
|
|
1861
|
-
|
|
1699
|
+
var name = getComponentName(type);
|
|
1700
|
+
var propTypes;
|
|
1862
1701
|
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1702
|
+
if (typeof type === 'function') {
|
|
1703
|
+
propTypes = type.propTypes;
|
|
1704
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1705
|
+
// Inner props are checked in the reconciler.
|
|
1706
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1707
|
+
propTypes = type.propTypes;
|
|
1708
|
+
} else {
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1872
1711
|
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1712
|
+
if (propTypes) {
|
|
1713
|
+
setCurrentlyValidatingElement(element);
|
|
1714
|
+
checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
|
1715
|
+
setCurrentlyValidatingElement(null);
|
|
1716
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1717
|
+
propTypesMisspellWarningShown = true;
|
|
1718
|
+
|
|
1719
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
|
1720
|
+
}
|
|
1881
1721
|
|
|
1882
|
-
|
|
1883
|
-
|
|
1722
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1723
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1724
|
+
}
|
|
1884
1725
|
}
|
|
1885
1726
|
}
|
|
1886
1727
|
/**
|
|
@@ -1890,115 +1731,26 @@ function validatePropTypes(element) {
|
|
|
1890
1731
|
|
|
1891
1732
|
|
|
1892
1733
|
function validateFragmentProps(fragment) {
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1897
|
-
var key = keys[i];
|
|
1898
|
-
|
|
1899
|
-
if (key !== 'children' && key !== 'key') {
|
|
1900
|
-
warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1901
|
-
break;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
if (fragment.ref !== null) {
|
|
1906
|
-
warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
setCurrentlyValidatingElement(null);
|
|
1910
|
-
}
|
|
1911
|
-
|
|
1912
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1913
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1914
|
-
// succeed and there will likely be errors in render.
|
|
1915
|
-
|
|
1916
|
-
if (!validType) {
|
|
1917
|
-
var info = '';
|
|
1918
|
-
|
|
1919
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1920
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1924
|
-
|
|
1925
|
-
if (sourceInfo) {
|
|
1926
|
-
info += sourceInfo;
|
|
1927
|
-
} else {
|
|
1928
|
-
info += getDeclarationErrorAddendum();
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
var typeString;
|
|
1932
|
-
|
|
1933
|
-
if (type === null) {
|
|
1934
|
-
typeString = 'null';
|
|
1935
|
-
} else if (Array.isArray(type)) {
|
|
1936
|
-
typeString = 'array';
|
|
1937
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1938
|
-
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
1939
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1940
|
-
} else {
|
|
1941
|
-
typeString = typeof type;
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1948
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1949
|
-
|
|
1950
|
-
if (element == null) {
|
|
1951
|
-
return element;
|
|
1952
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1953
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1954
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
1955
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1956
|
-
// fixed, the key warnings will appear.)
|
|
1957
|
-
|
|
1734
|
+
{
|
|
1735
|
+
setCurrentlyValidatingElement(fragment);
|
|
1736
|
+
var keys = Object.keys(fragment.props);
|
|
1958
1737
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1738
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1739
|
+
var key = keys[i];
|
|
1961
1740
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
if (Array.isArray(children)) {
|
|
1965
|
-
for (var i = 0; i < children.length; i++) {
|
|
1966
|
-
validateChildKeys(children[i], type);
|
|
1967
|
-
}
|
|
1741
|
+
if (key !== 'children' && key !== 'key') {
|
|
1742
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1968
1743
|
|
|
1969
|
-
|
|
1970
|
-
Object.freeze(children);
|
|
1971
|
-
}
|
|
1972
|
-
} else {
|
|
1973
|
-
warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
1974
|
-
}
|
|
1975
|
-
} else {
|
|
1976
|
-
validateChildKeys(children, type);
|
|
1744
|
+
break;
|
|
1977
1745
|
}
|
|
1978
1746
|
}
|
|
1979
|
-
}
|
|
1980
1747
|
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1748
|
+
if (fragment.ref !== null) {
|
|
1749
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1750
|
+
}
|
|
1984
1751
|
|
|
1985
|
-
|
|
1986
|
-
validateFragmentProps(element);
|
|
1987
|
-
} else {
|
|
1988
|
-
validatePropTypes(element);
|
|
1752
|
+
setCurrentlyValidatingElement(null);
|
|
1989
1753
|
}
|
|
1990
|
-
|
|
1991
|
-
return element;
|
|
1992
|
-
} // These two functions exist to still get child warnings in dev
|
|
1993
|
-
// even with the prod transform. This means that jsxDEV is purely
|
|
1994
|
-
// opt-in behavior for better messages but that we won't stop
|
|
1995
|
-
// giving you warnings if you use production apis.
|
|
1996
|
-
|
|
1997
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
1998
|
-
return jsxWithValidation(type, props, key, true);
|
|
1999
|
-
}
|
|
2000
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
2001
|
-
return jsxWithValidation(type, props, key, false);
|
|
2002
1754
|
}
|
|
2003
1755
|
function createElementWithValidation(type, props, children) {
|
|
2004
1756
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
@@ -2032,7 +1784,9 @@ function createElementWithValidation(type, props, children) {
|
|
|
2032
1784
|
typeString = typeof type;
|
|
2033
1785
|
}
|
|
2034
1786
|
|
|
2035
|
-
|
|
1787
|
+
{
|
|
1788
|
+
error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1789
|
+
}
|
|
2036
1790
|
}
|
|
2037
1791
|
|
|
2038
1792
|
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
@@ -2061,15 +1815,24 @@ function createElementWithValidation(type, props, children) {
|
|
|
2061
1815
|
|
|
2062
1816
|
return element;
|
|
2063
1817
|
}
|
|
1818
|
+
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2064
1819
|
function createFactoryWithValidation(type) {
|
|
2065
1820
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
2066
|
-
validatedFactory.type = type;
|
|
1821
|
+
validatedFactory.type = type;
|
|
2067
1822
|
|
|
2068
1823
|
{
|
|
1824
|
+
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
1825
|
+
didWarnAboutDeprecatedCreateFactory = true;
|
|
1826
|
+
|
|
1827
|
+
warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
|
1828
|
+
} // Legacy hook: remove it
|
|
1829
|
+
|
|
1830
|
+
|
|
2069
1831
|
Object.defineProperty(validatedFactory, 'type', {
|
|
2070
1832
|
enumerable: false,
|
|
2071
1833
|
get: function () {
|
|
2072
|
-
|
|
1834
|
+
warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
1835
|
+
|
|
2073
1836
|
Object.defineProperty(this, 'type', {
|
|
2074
1837
|
value: type
|
|
2075
1838
|
});
|
|
@@ -2091,10 +1854,7 @@ function cloneElementWithValidation(element, props, children) {
|
|
|
2091
1854
|
return newElement;
|
|
2092
1855
|
}
|
|
2093
1856
|
|
|
2094
|
-
var hasBadMapPolyfill;
|
|
2095
|
-
|
|
2096
1857
|
{
|
|
2097
|
-
hasBadMapPolyfill = false;
|
|
2098
1858
|
|
|
2099
1859
|
try {
|
|
2100
1860
|
var frozenObject = Object.freeze({});
|
|
@@ -2106,213 +1866,47 @@ var hasBadMapPolyfill;
|
|
|
2106
1866
|
testMap.set(0, 0);
|
|
2107
1867
|
testSet.add(0);
|
|
2108
1868
|
} catch (e) {
|
|
2109
|
-
// TODO: Consider warning about bad polyfills
|
|
2110
|
-
hasBadMapPolyfill = true;
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
function createFundamentalComponent(impl) {
|
|
2115
|
-
// We use responder as a Map key later on. When we have a bad
|
|
2116
|
-
// polyfill, then we can't use it as a key as the polyfill tries
|
|
2117
|
-
// to add a property to the object.
|
|
2118
|
-
if (true && !hasBadMapPolyfill) {
|
|
2119
|
-
Object.freeze(impl);
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
var fundamantalComponent = {
|
|
2123
|
-
$$typeof: REACT_FUNDAMENTAL_TYPE,
|
|
2124
|
-
impl: impl
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
{
|
|
2128
|
-
Object.freeze(fundamantalComponent);
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
return fundamantalComponent;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
function createEventResponder(displayName, responderConfig) {
|
|
2135
|
-
var getInitialState = responderConfig.getInitialState,
|
|
2136
|
-
onEvent = responderConfig.onEvent,
|
|
2137
|
-
onMount = responderConfig.onMount,
|
|
2138
|
-
onUnmount = responderConfig.onUnmount,
|
|
2139
|
-
onRootEvent = responderConfig.onRootEvent,
|
|
2140
|
-
rootEventTypes = responderConfig.rootEventTypes,
|
|
2141
|
-
targetEventTypes = responderConfig.targetEventTypes,
|
|
2142
|
-
targetPortalPropagation = responderConfig.targetPortalPropagation;
|
|
2143
|
-
var eventResponder = {
|
|
2144
|
-
$$typeof: REACT_RESPONDER_TYPE,
|
|
2145
|
-
displayName: displayName,
|
|
2146
|
-
getInitialState: getInitialState || null,
|
|
2147
|
-
onEvent: onEvent || null,
|
|
2148
|
-
onMount: onMount || null,
|
|
2149
|
-
onRootEvent: onRootEvent || null,
|
|
2150
|
-
onUnmount: onUnmount || null,
|
|
2151
|
-
rootEventTypes: rootEventTypes || null,
|
|
2152
|
-
targetEventTypes: targetEventTypes || null,
|
|
2153
|
-
targetPortalPropagation: targetPortalPropagation || false
|
|
2154
|
-
}; // We use responder as a Map key later on. When we have a bad
|
|
2155
|
-
// polyfill, then we can't use it as a key as the polyfill tries
|
|
2156
|
-
// to add a property to the object.
|
|
2157
|
-
|
|
2158
|
-
if (true && !hasBadMapPolyfill) {
|
|
2159
|
-
Object.freeze(eventResponder);
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
return eventResponder;
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
function createScope() {
|
|
2166
|
-
var scopeComponent = {
|
|
2167
|
-
$$typeof: REACT_SCOPE_TYPE
|
|
2168
|
-
};
|
|
2169
|
-
|
|
2170
|
-
{
|
|
2171
|
-
Object.freeze(scopeComponent);
|
|
2172
1869
|
}
|
|
2173
|
-
|
|
2174
|
-
return scopeComponent;
|
|
2175
1870
|
}
|
|
2176
1871
|
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
2188
|
-
|
|
2189
|
-
// Gather advanced timing metrics for Profiler subtrees.
|
|
2190
|
-
|
|
2191
|
-
// Trace which interactions trigger each commit.
|
|
2192
|
-
|
|
2193
|
-
// SSR experiments
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
// Only used in www builds.
|
|
2197
|
-
|
|
2198
|
-
// Only used in www builds.
|
|
2199
|
-
|
|
2200
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
2201
|
-
|
|
2202
|
-
// React Fire: prevent the value and checked attributes from syncing
|
|
2203
|
-
// with their related DOM properties
|
|
2204
|
-
|
|
2205
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
2206
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
2207
|
-
|
|
2208
|
-
var exposeConcurrentModeAPIs = false;
|
|
2209
|
-
// Experimental React Flare event system and event components support.
|
|
2210
|
-
|
|
2211
|
-
var enableFlareAPI = false; // Experimental Host Component support.
|
|
2212
|
-
|
|
2213
|
-
var enableFundamentalAPI = false; // Experimental Scope support.
|
|
2214
|
-
|
|
2215
|
-
var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
2216
|
-
|
|
2217
|
-
var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
2218
|
-
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
|
|
2219
|
-
|
|
2220
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
2221
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
2222
|
-
|
|
2223
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
2224
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
2225
|
-
// the user to see a loading state.
|
|
2226
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
2227
|
-
// hydrated or deleted.
|
|
2228
|
-
|
|
2229
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
2230
|
-
// from React.createElement to React.jsx
|
|
2231
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
2232
|
-
|
|
2233
|
-
var React = {
|
|
2234
|
-
Children: {
|
|
2235
|
-
map: mapChildren,
|
|
2236
|
-
forEach: forEachChildren,
|
|
2237
|
-
count: countChildren,
|
|
2238
|
-
toArray: toArray,
|
|
2239
|
-
only: onlyChild
|
|
2240
|
-
},
|
|
2241
|
-
createRef: createRef,
|
|
2242
|
-
Component: Component,
|
|
2243
|
-
PureComponent: PureComponent,
|
|
2244
|
-
createContext: createContext,
|
|
2245
|
-
forwardRef: forwardRef,
|
|
2246
|
-
lazy: lazy,
|
|
2247
|
-
memo: memo,
|
|
2248
|
-
useCallback: useCallback,
|
|
2249
|
-
useContext: useContext,
|
|
2250
|
-
useEffect: useEffect,
|
|
2251
|
-
useImperativeHandle: useImperativeHandle,
|
|
2252
|
-
useDebugValue: useDebugValue,
|
|
2253
|
-
useLayoutEffect: useLayoutEffect,
|
|
2254
|
-
useMemo: useMemo,
|
|
2255
|
-
useReducer: useReducer,
|
|
2256
|
-
useRef: useRef,
|
|
2257
|
-
useState: useState,
|
|
2258
|
-
Fragment: REACT_FRAGMENT_TYPE,
|
|
2259
|
-
Profiler: REACT_PROFILER_TYPE,
|
|
2260
|
-
StrictMode: REACT_STRICT_MODE_TYPE,
|
|
2261
|
-
Suspense: REACT_SUSPENSE_TYPE,
|
|
2262
|
-
createElement: createElementWithValidation,
|
|
2263
|
-
cloneElement: cloneElementWithValidation,
|
|
2264
|
-
createFactory: createFactoryWithValidation,
|
|
2265
|
-
isValidElement: isValidElement,
|
|
2266
|
-
version: ReactVersion,
|
|
2267
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
|
1872
|
+
var createElement$1 = createElementWithValidation ;
|
|
1873
|
+
var cloneElement$1 = cloneElementWithValidation ;
|
|
1874
|
+
var createFactory = createFactoryWithValidation ;
|
|
1875
|
+
var Children = {
|
|
1876
|
+
map: mapChildren,
|
|
1877
|
+
forEach: forEachChildren,
|
|
1878
|
+
count: countChildren,
|
|
1879
|
+
toArray: toArray,
|
|
1880
|
+
only: onlyChild
|
|
2268
1881
|
};
|
|
2269
1882
|
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
React.jsxs = jsxWithValidationStatic;
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
var React$2 = Object.freeze({
|
|
2305
|
-
default: React
|
|
2306
|
-
});
|
|
2307
|
-
|
|
2308
|
-
var React$3 = ( React$2 && React ) || React$2;
|
|
2309
|
-
|
|
2310
|
-
// TODO: decide on the top-level export form.
|
|
2311
|
-
// This is hacky but makes it work with both Rollup and Jest.
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
var react = React$3.default || React$3;
|
|
2315
|
-
|
|
2316
|
-
module.exports = react;
|
|
1883
|
+
exports.Children = Children;
|
|
1884
|
+
exports.Component = Component;
|
|
1885
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1886
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
1887
|
+
exports.PureComponent = PureComponent;
|
|
1888
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1889
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
1890
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
1891
|
+
exports.cloneElement = cloneElement$1;
|
|
1892
|
+
exports.createContext = createContext;
|
|
1893
|
+
exports.createElement = createElement$1;
|
|
1894
|
+
exports.createFactory = createFactory;
|
|
1895
|
+
exports.createRef = createRef;
|
|
1896
|
+
exports.forwardRef = forwardRef;
|
|
1897
|
+
exports.isValidElement = isValidElement;
|
|
1898
|
+
exports.lazy = lazy;
|
|
1899
|
+
exports.memo = memo;
|
|
1900
|
+
exports.useCallback = useCallback;
|
|
1901
|
+
exports.useContext = useContext;
|
|
1902
|
+
exports.useDebugValue = useDebugValue;
|
|
1903
|
+
exports.useEffect = useEffect;
|
|
1904
|
+
exports.useImperativeHandle = useImperativeHandle;
|
|
1905
|
+
exports.useLayoutEffect = useLayoutEffect;
|
|
1906
|
+
exports.useMemo = useMemo;
|
|
1907
|
+
exports.useReducer = useReducer;
|
|
1908
|
+
exports.useRef = useRef;
|
|
1909
|
+
exports.useState = useState;
|
|
1910
|
+
exports.version = ReactVersion;
|
|
2317
1911
|
})();
|
|
2318
1912
|
}
|