react-dom 16.10.2 → 16.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/react-dom-server.browser.development.js +411 -729
- package/cjs/react-dom-server.browser.production.min.js +41 -41
- package/cjs/react-dom-server.node.development.js +406 -720
- package/cjs/react-dom-server.node.production.min.js +40 -40
- package/cjs/react-dom-test-utils.development.js +200 -393
- package/cjs/react-dom-test-utils.production.min.js +22 -22
- package/cjs/react-dom-unstable-fizz.browser.development.js +11 -25
- package/cjs/react-dom-unstable-fizz.browser.production.min.js +3 -3
- package/cjs/react-dom-unstable-fizz.node.development.js +24 -27
- package/cjs/react-dom-unstable-fizz.node.production.min.js +4 -3
- package/cjs/react-dom-unstable-native-dependencies.development.js +203 -338
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +23 -27
- package/cjs/react-dom.development.js +10451 -13365
- package/cjs/react-dom.production.min.js +280 -281
- package/cjs/react-dom.profiling.min.js +285 -285
- package/package.json +3 -3
- package/umd/react-dom-server.browser.development.js +3310 -3639
- package/umd/react-dom-server.browser.production.min.js +38 -38
- package/umd/react-dom-test-utils.development.js +1181 -1374
- package/umd/react-dom-test-utils.production.min.js +23 -23
- package/umd/react-dom-unstable-fizz.browser.development.js +105 -119
- package/umd/react-dom-unstable-fizz.browser.production.min.js +3 -3
- package/umd/react-dom-unstable-native-dependencies.development.js +1326 -1462
- package/umd/react-dom-unstable-native-dependencies.production.min.js +21 -22
- package/umd/react-dom.development.js +19905 -22830
- package/umd/react-dom.production.min.js +229 -234
- package/umd/react-dom.profiling.min.js +237 -241
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.13.1
|
|
2
2
|
* react-dom-server.node.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,75 +15,92 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
(function() {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
var _assign = require('object-assign');
|
|
19
18
|
var React = require('react');
|
|
19
|
+
var _assign = require('object-assign');
|
|
20
20
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
21
21
|
var stream = require('stream');
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var ReactVersion = '16.10.2';
|
|
23
|
+
var ReactVersion = '16.13.1';
|
|
26
24
|
|
|
27
25
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
28
|
-
// template literal strings. The messages will be
|
|
29
|
-
// build
|
|
26
|
+
// template literal strings. The messages will be replaced with error codes
|
|
27
|
+
// during build.
|
|
28
|
+
function formatProdErrorMessage(code) {
|
|
29
|
+
var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
error
|
|
36
|
-
return error;
|
|
31
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
32
|
+
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
43
|
-
* to provide information about what broke and what you were
|
|
44
|
-
* expecting.
|
|
45
|
-
*
|
|
46
|
-
* The invariant message will be stripped in production, but the invariant
|
|
47
|
-
* will remain to ensure logic does not differ in production.
|
|
48
|
-
*/
|
|
38
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
|
|
39
|
+
// Current owner and dispatcher used to share the same ref,
|
|
40
|
+
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*/
|
|
56
|
-
var warningWithoutStack = function () {};
|
|
42
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
43
|
+
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
44
|
+
current: null
|
|
45
|
+
};
|
|
46
|
+
}
|
|
57
47
|
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
49
|
+
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
50
|
+
suspense: null
|
|
51
|
+
};
|
|
52
|
+
}
|
|
63
53
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
// by calls to these methods by a Babel plugin.
|
|
55
|
+
//
|
|
56
|
+
// In PROD (or in packages without access to React internals),
|
|
57
|
+
// they are left as they are instead.
|
|
67
58
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
function warn(format) {
|
|
60
|
+
{
|
|
61
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
62
|
+
args[_key - 1] = arguments[_key];
|
|
71
63
|
}
|
|
72
64
|
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
printWarning('warn', format, args);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function error(format) {
|
|
69
|
+
{
|
|
70
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
71
|
+
args[_key2 - 1] = arguments[_key2];
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
82
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
74
|
+
printWarning('error', format, args);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
function printWarning(level, format, args) {
|
|
79
|
+
// When changing this logic, you might want to also
|
|
80
|
+
// update consoleWithStackDev.www.js as well.
|
|
81
|
+
{
|
|
82
|
+
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
|
|
83
|
+
|
|
84
|
+
if (!hasExistingStack) {
|
|
85
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
86
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
87
|
+
|
|
88
|
+
if (stack !== '') {
|
|
89
|
+
format += '%s';
|
|
90
|
+
args = args.concat([stack]);
|
|
91
|
+
}
|
|
85
92
|
}
|
|
86
93
|
|
|
94
|
+
var argsWithFormat = args.map(function (item) {
|
|
95
|
+
return '' + item;
|
|
96
|
+
}); // Careful: RN currently depends on this prefix
|
|
97
|
+
|
|
98
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
99
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
100
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
101
|
+
|
|
102
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
103
|
+
|
|
87
104
|
try {
|
|
88
105
|
// --- Welcome to debugging React ---
|
|
89
106
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -94,78 +111,28 @@ var warningWithoutStack = function () {};
|
|
|
94
111
|
});
|
|
95
112
|
throw new Error(message);
|
|
96
113
|
} catch (x) {}
|
|
97
|
-
}
|
|
114
|
+
}
|
|
98
115
|
}
|
|
99
116
|
|
|
100
|
-
var warningWithoutStack$1 = warningWithoutStack;
|
|
101
|
-
|
|
102
117
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
103
118
|
// nor polyfill, then a plain number is used for performance.
|
|
104
119
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
105
|
-
|
|
106
120
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
107
121
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
108
122
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
109
123
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
110
124
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
111
125
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
112
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
113
|
-
|
|
114
|
-
|
|
115
126
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
116
127
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
117
128
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
118
129
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
119
130
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
120
131
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
132
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
121
133
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
122
|
-
|
|
123
134
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
124
135
|
|
|
125
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
|
|
126
|
-
// Current owner and dispatcher used to share the same ref,
|
|
127
|
-
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
128
|
-
|
|
129
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
130
|
-
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
131
|
-
current: null
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
136
|
-
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
137
|
-
suspense: null
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
143
|
-
* This can be used to log issues in development environments in critical
|
|
144
|
-
* paths. Removing the logging code for production environments will keep the
|
|
145
|
-
* same logic and follow the same code paths.
|
|
146
|
-
*/
|
|
147
|
-
|
|
148
|
-
var warning = warningWithoutStack$1;
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
warning = function (condition, format) {
|
|
152
|
-
if (condition) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
157
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
158
|
-
|
|
159
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
160
|
-
args[_key - 2] = arguments[_key];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
var warning$1 = warning;
|
|
168
|
-
|
|
169
136
|
var Uninitialized = -1;
|
|
170
137
|
var Pending = 0;
|
|
171
138
|
var Resolved = 1;
|
|
@@ -185,7 +152,7 @@ function initializeLazyComponentType(lazyComponent) {
|
|
|
185
152
|
|
|
186
153
|
{
|
|
187
154
|
if (defaultExport === undefined) {
|
|
188
|
-
|
|
155
|
+
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
|
189
156
|
}
|
|
190
157
|
}
|
|
191
158
|
|
|
@@ -214,7 +181,7 @@ function getComponentName(type) {
|
|
|
214
181
|
|
|
215
182
|
{
|
|
216
183
|
if (typeof type.tag === 'number') {
|
|
217
|
-
|
|
184
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
218
185
|
}
|
|
219
186
|
}
|
|
220
187
|
|
|
@@ -260,6 +227,9 @@ function getComponentName(type) {
|
|
|
260
227
|
case REACT_MEMO_TYPE:
|
|
261
228
|
return getComponentName(type.type);
|
|
262
229
|
|
|
230
|
+
case REACT_BLOCK_TYPE:
|
|
231
|
+
return getComponentName(type.render);
|
|
232
|
+
|
|
263
233
|
case REACT_LAZY_TYPE:
|
|
264
234
|
{
|
|
265
235
|
var thenable = type;
|
|
@@ -277,63 +247,8 @@ function getComponentName(type) {
|
|
|
277
247
|
return null;
|
|
278
248
|
}
|
|
279
249
|
|
|
280
|
-
/**
|
|
281
|
-
* Forked from fbjs/warning:
|
|
282
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
283
|
-
*
|
|
284
|
-
* Only change is we use console.warn instead of console.error,
|
|
285
|
-
* and do nothing when 'console' is not supported.
|
|
286
|
-
* This really simplifies the code.
|
|
287
|
-
* ---
|
|
288
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
289
|
-
* This can be used to log issues in development environments in critical
|
|
290
|
-
* paths. Removing the logging code for production environments will keep the
|
|
291
|
-
* same logic and follow the same code paths.
|
|
292
|
-
*/
|
|
293
|
-
var lowPriorityWarningWithoutStack = function () {};
|
|
294
|
-
|
|
295
|
-
{
|
|
296
|
-
var printWarning = function (format) {
|
|
297
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
298
|
-
args[_key - 1] = arguments[_key];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
var argIndex = 0;
|
|
302
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
303
|
-
return args[argIndex++];
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
if (typeof console !== 'undefined') {
|
|
307
|
-
console.warn(message);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
try {
|
|
311
|
-
// --- Welcome to debugging React ---
|
|
312
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
313
|
-
// to find the callsite that caused this warning to fire.
|
|
314
|
-
throw new Error(message);
|
|
315
|
-
} catch (x) {}
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
319
|
-
if (format === undefined) {
|
|
320
|
-
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (!condition) {
|
|
324
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
325
|
-
args[_key2 - 2] = arguments[_key2];
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
printWarning.apply(void 0, [format].concat(args));
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
334
|
-
|
|
335
250
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
336
|
-
|
|
251
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
337
252
|
var sourceInfo = '';
|
|
338
253
|
|
|
339
254
|
if (source) {
|
|
@@ -363,81 +278,17 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
363
278
|
}
|
|
364
279
|
|
|
365
280
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
369
|
-
|
|
370
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
371
|
-
// This can be confusing for tests though,
|
|
372
|
-
// And it can be bad for performance in production.
|
|
373
|
-
// This feature flag can be used to control the behavior:
|
|
374
|
-
|
|
375
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
376
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
377
|
-
|
|
378
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
379
|
-
|
|
380
|
-
var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
|
|
381
|
-
|
|
382
|
-
// Trace which interactions trigger each commit.
|
|
383
|
-
|
|
384
|
-
// Only used in www builds.
|
|
385
|
-
|
|
386
|
-
var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.
|
|
387
|
-
|
|
388
|
-
// Only used in www builds.
|
|
389
|
-
|
|
390
|
-
// Only used in www builds.
|
|
391
|
-
|
|
392
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
393
|
-
|
|
394
|
-
var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
|
|
395
|
-
// with their related DOM properties
|
|
396
|
-
|
|
397
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
398
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
// See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
|
|
402
|
-
// This is a flag so we can fix warnings in RN core before turning it on
|
|
403
|
-
|
|
404
|
-
// Experimental React Flare event system and event components support.
|
|
405
|
-
|
|
406
|
-
var enableFlareAPI = false; // Experimental Host Component support.
|
|
407
|
-
|
|
408
|
-
var enableFundamentalAPI = false; // Experimental Scope support.
|
|
409
|
-
|
|
410
|
-
var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
411
|
-
|
|
412
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
413
|
-
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
|
|
414
|
-
|
|
415
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
416
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
417
|
-
|
|
418
|
-
// Changes priority of some events like mousemove to user-blocking priority,
|
|
419
|
-
// but without making them discrete. The flag exists in case it causes
|
|
420
|
-
// starvation problems.
|
|
421
|
-
|
|
422
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
423
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
424
|
-
// the user to see a loading state.
|
|
425
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
426
|
-
// hydrated or deleted.
|
|
427
|
-
|
|
428
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
429
|
-
// from React.createElement to React.jsx
|
|
430
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
431
|
-
|
|
281
|
+
}
|
|
432
282
|
|
|
283
|
+
var enableSuspenseServerRenderer = false;
|
|
433
284
|
|
|
434
|
-
var
|
|
285
|
+
var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
|
|
435
286
|
|
|
436
|
-
var ReactDebugCurrentFrame
|
|
287
|
+
var ReactDebugCurrentFrame;
|
|
437
288
|
var didWarnAboutInvalidateContextType;
|
|
438
289
|
|
|
439
290
|
{
|
|
440
|
-
ReactDebugCurrentFrame
|
|
291
|
+
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
441
292
|
didWarnAboutInvalidateContextType = new Set();
|
|
442
293
|
}
|
|
443
294
|
|
|
@@ -465,7 +316,7 @@ function maskContext(type, context) {
|
|
|
465
316
|
|
|
466
317
|
function checkContextTypes(typeSpecs, values, location) {
|
|
467
318
|
{
|
|
468
|
-
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame
|
|
319
|
+
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack);
|
|
469
320
|
}
|
|
470
321
|
}
|
|
471
322
|
|
|
@@ -508,7 +359,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
508
359
|
addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
|
|
509
360
|
}
|
|
510
361
|
|
|
511
|
-
|
|
362
|
+
error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
|
|
512
363
|
}
|
|
513
364
|
}
|
|
514
365
|
}
|
|
@@ -518,15 +369,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
518
369
|
return contextType[threadID];
|
|
519
370
|
}
|
|
520
371
|
|
|
521
|
-
|
|
522
|
-
{
|
|
523
|
-
if (type.contextTypes) {
|
|
524
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
return emptyObject;
|
|
529
|
-
} else {
|
|
372
|
+
{
|
|
530
373
|
var maskedContext = maskContext(type, context);
|
|
531
374
|
|
|
532
375
|
{
|
|
@@ -538,15 +381,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
538
381
|
return maskedContext;
|
|
539
382
|
}
|
|
540
383
|
} else {
|
|
541
|
-
|
|
542
|
-
{
|
|
543
|
-
if (type.contextTypes) {
|
|
544
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
return undefined;
|
|
549
|
-
} else {
|
|
384
|
+
{
|
|
550
385
|
var _maskedContext = maskContext(type, context);
|
|
551
386
|
|
|
552
387
|
{
|
|
@@ -560,9 +395,6 @@ function processContext(type, context, threadID, isClass) {
|
|
|
560
395
|
}
|
|
561
396
|
}
|
|
562
397
|
|
|
563
|
-
// Allocates a new index for each request. Tries to stay as compact as possible so that these
|
|
564
|
-
// indices can be used to reference a tightly packed array. As opposed to being used in a Map.
|
|
565
|
-
// The first allocated index is 1.
|
|
566
398
|
var nextAvailableThreadIDs = new Uint16Array(16);
|
|
567
399
|
|
|
568
400
|
for (var i = 0; i < 15; i++) {
|
|
@@ -576,13 +408,11 @@ function growThreadCountAndReturnNextAvailable() {
|
|
|
576
408
|
var oldSize = oldArray.length;
|
|
577
409
|
var newSize = oldSize * 2;
|
|
578
410
|
|
|
579
|
-
(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
throw ReactError(Error("Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic."));
|
|
583
|
-
}
|
|
411
|
+
if (!(newSize <= 0x10000)) {
|
|
412
|
+
{
|
|
413
|
+
throw Error( "Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic." );
|
|
584
414
|
}
|
|
585
|
-
}
|
|
415
|
+
}
|
|
586
416
|
|
|
587
417
|
var newArray = new Uint16Array(newSize);
|
|
588
418
|
newArray.set(oldArray);
|
|
@@ -644,18 +474,17 @@ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\
|
|
|
644
474
|
/* eslint-enable max-len */
|
|
645
475
|
|
|
646
476
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
647
|
-
|
|
648
477
|
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
|
649
478
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
650
|
-
var hasOwnProperty
|
|
479
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
651
480
|
var illegalAttributeNameCache = {};
|
|
652
481
|
var validatedAttributeNameCache = {};
|
|
653
482
|
function isAttributeNameSafe(attributeName) {
|
|
654
|
-
if (hasOwnProperty
|
|
483
|
+
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
|
655
484
|
return true;
|
|
656
485
|
}
|
|
657
486
|
|
|
658
|
-
if (hasOwnProperty
|
|
487
|
+
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
|
659
488
|
return false;
|
|
660
489
|
}
|
|
661
490
|
|
|
@@ -667,7 +496,7 @@ function isAttributeNameSafe(attributeName) {
|
|
|
667
496
|
illegalAttributeNameCache[attributeName] = true;
|
|
668
497
|
|
|
669
498
|
{
|
|
670
|
-
|
|
499
|
+
error('Invalid attribute name: `%s`', attributeName);
|
|
671
500
|
}
|
|
672
501
|
|
|
673
502
|
return false;
|
|
@@ -767,10 +596,12 @@ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attribut
|
|
|
767
596
|
|
|
768
597
|
var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
|
|
769
598
|
|
|
770
|
-
['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
|
|
599
|
+
var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
|
|
771
600
|
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
772
601
|
// defaultValue property -- do we need this?
|
|
773
|
-
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']
|
|
602
|
+
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
|
|
603
|
+
|
|
604
|
+
reservedProps.forEach(function (name) {
|
|
774
605
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
775
606
|
name, // attributeName
|
|
776
607
|
null, // attributeNamespace
|
|
@@ -819,7 +650,10 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
819
650
|
|
|
820
651
|
['checked', // Note: `option.selected` is not updated if `select.multiple` is
|
|
821
652
|
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
822
|
-
'multiple', 'muted', 'selected'
|
|
653
|
+
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
|
|
654
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
655
|
+
// instead in the assignment below.
|
|
656
|
+
].forEach(function (name) {
|
|
823
657
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
824
658
|
name, // attributeName
|
|
825
659
|
null, // attributeNamespace
|
|
@@ -827,14 +661,20 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
827
661
|
}); // These are HTML attributes that are "overloaded booleans": they behave like
|
|
828
662
|
// booleans, but can also accept a string value.
|
|
829
663
|
|
|
830
|
-
['capture', 'download'
|
|
664
|
+
['capture', 'download' // NOTE: if you add a camelCased prop to this list,
|
|
665
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
666
|
+
// instead in the assignment below.
|
|
667
|
+
].forEach(function (name) {
|
|
831
668
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
832
669
|
name, // attributeName
|
|
833
670
|
null, // attributeNamespace
|
|
834
671
|
false);
|
|
835
672
|
}); // These are HTML attributes that must be positive numbers.
|
|
836
673
|
|
|
837
|
-
['cols', 'rows', 'size', 'span'
|
|
674
|
+
['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
|
|
675
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
676
|
+
// instead in the assignment below.
|
|
677
|
+
].forEach(function (name) {
|
|
838
678
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
839
679
|
name, // attributeName
|
|
840
680
|
null, // attributeNamespace
|
|
@@ -855,23 +695,32 @@ var capitalize = function (token) {
|
|
|
855
695
|
// or boolean value assignment. Regular attributes that just accept strings
|
|
856
696
|
// and have the same names are omitted, just like in the HTML whitelist.
|
|
857
697
|
// Some of these attributes can be hard to find. This list was created by
|
|
858
|
-
//
|
|
698
|
+
// scraping the MDN documentation.
|
|
859
699
|
|
|
860
700
|
|
|
861
|
-
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'
|
|
701
|
+
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
|
|
702
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
703
|
+
// instead in the assignment below.
|
|
704
|
+
].forEach(function (attributeName) {
|
|
862
705
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
863
706
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
864
707
|
attributeName, null, // attributeNamespace
|
|
865
708
|
false);
|
|
866
709
|
}); // String SVG attributes with the xlink namespace.
|
|
867
710
|
|
|
868
|
-
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'
|
|
711
|
+
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
|
|
712
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
713
|
+
// instead in the assignment below.
|
|
714
|
+
].forEach(function (attributeName) {
|
|
869
715
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
870
716
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
871
717
|
attributeName, 'http://www.w3.org/1999/xlink', false);
|
|
872
718
|
}); // String SVG attributes with the xml namespace.
|
|
873
719
|
|
|
874
|
-
['xml:base', 'xml:lang', 'xml:space'
|
|
720
|
+
['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
|
|
721
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
722
|
+
// instead in the assignment below.
|
|
723
|
+
].forEach(function (attributeName) {
|
|
875
724
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
876
725
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
877
726
|
attributeName, 'http://www.w3.org/XML/1998/namespace', false);
|
|
@@ -897,10 +746,10 @@ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mu
|
|
|
897
746
|
true);
|
|
898
747
|
});
|
|
899
748
|
|
|
900
|
-
var ReactDebugCurrentFrame$
|
|
749
|
+
var ReactDebugCurrentFrame$1 = null;
|
|
901
750
|
|
|
902
751
|
{
|
|
903
|
-
ReactDebugCurrentFrame$
|
|
752
|
+
ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
904
753
|
} // A javascript: URL can contain leading C0 control or \u0020 SPACE,
|
|
905
754
|
// and any newline or tab are filtered out as if they're not part of the URL.
|
|
906
755
|
// https://url.spec.whatwg.org/#url-parsing
|
|
@@ -917,17 +766,12 @@ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r
|
|
|
917
766
|
var didWarn = false;
|
|
918
767
|
|
|
919
768
|
function sanitizeURL(url) {
|
|
920
|
-
|
|
921
|
-
(
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
})();
|
|
928
|
-
} else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
|
|
929
|
-
didWarn = true;
|
|
930
|
-
warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
|
|
769
|
+
{
|
|
770
|
+
if (!didWarn && isJavaScriptProtocol.test(url)) {
|
|
771
|
+
didWarn = true;
|
|
772
|
+
|
|
773
|
+
error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
|
|
774
|
+
}
|
|
931
775
|
}
|
|
932
776
|
}
|
|
933
777
|
|
|
@@ -1032,18 +876,6 @@ function quoteAttributeValueForBrowser(value) {
|
|
|
1032
876
|
return '"' + escapeTextForBrowser(value) + '"';
|
|
1033
877
|
}
|
|
1034
878
|
|
|
1035
|
-
/**
|
|
1036
|
-
* Operations for dealing with DOM properties.
|
|
1037
|
-
*/
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Creates markup for the ID property.
|
|
1041
|
-
*
|
|
1042
|
-
* @param {string} id Unescaped ID.
|
|
1043
|
-
* @return {string} Markup string.
|
|
1044
|
-
*/
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
879
|
function createMarkupForRoot() {
|
|
1048
880
|
return ROOT_ATTRIBUTE_NAME + '=""';
|
|
1049
881
|
}
|
|
@@ -1111,7 +943,7 @@ function is(x, y) {
|
|
|
1111
943
|
;
|
|
1112
944
|
}
|
|
1113
945
|
|
|
1114
|
-
var
|
|
946
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
1115
947
|
|
|
1116
948
|
var currentlyRenderingComponent = null;
|
|
1117
949
|
var firstWorkInProgressHook = null;
|
|
@@ -1130,16 +962,16 @@ var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently
|
|
|
1130
962
|
var currentHookNameInDev;
|
|
1131
963
|
|
|
1132
964
|
function resolveCurrentlyRenderingComponent() {
|
|
1133
|
-
(
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
throw ReactError(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."));
|
|
1137
|
-
}
|
|
965
|
+
if (!(currentlyRenderingComponent !== null)) {
|
|
966
|
+
{
|
|
967
|
+
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." );
|
|
1138
968
|
}
|
|
1139
|
-
}
|
|
969
|
+
}
|
|
1140
970
|
|
|
1141
971
|
{
|
|
1142
|
-
|
|
972
|
+
if (isInHookUserCodeInDev) {
|
|
973
|
+
error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
|
|
974
|
+
}
|
|
1143
975
|
}
|
|
1144
976
|
|
|
1145
977
|
return currentlyRenderingComponent;
|
|
@@ -1148,7 +980,7 @@ function resolveCurrentlyRenderingComponent() {
|
|
|
1148
980
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
1149
981
|
if (prevDeps === null) {
|
|
1150
982
|
{
|
|
1151
|
-
|
|
983
|
+
error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
|
|
1152
984
|
}
|
|
1153
985
|
|
|
1154
986
|
return false;
|
|
@@ -1158,12 +990,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
1158
990
|
// Don't bother comparing lengths in prod because these arrays should be
|
|
1159
991
|
// passed inline.
|
|
1160
992
|
if (nextDeps.length !== prevDeps.length) {
|
|
1161
|
-
|
|
993
|
+
error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + nextDeps.join(', ') + "]", "[" + prevDeps.join(', ') + "]");
|
|
1162
994
|
}
|
|
1163
995
|
}
|
|
1164
996
|
|
|
1165
997
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
|
1166
|
-
if (
|
|
998
|
+
if (objectIs(nextDeps[i], prevDeps[i])) {
|
|
1167
999
|
continue;
|
|
1168
1000
|
}
|
|
1169
1001
|
|
|
@@ -1175,13 +1007,11 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
1175
1007
|
|
|
1176
1008
|
function createHook() {
|
|
1177
1009
|
if (numberOfReRenders > 0) {
|
|
1178
|
-
|
|
1010
|
+
{
|
|
1179
1011
|
{
|
|
1180
|
-
|
|
1181
|
-
throw ReactError(Error("Rendered more hooks than during the previous render"));
|
|
1182
|
-
}
|
|
1012
|
+
throw Error( "Rendered more hooks than during the previous render" );
|
|
1183
1013
|
}
|
|
1184
|
-
}
|
|
1014
|
+
}
|
|
1185
1015
|
}
|
|
1186
1016
|
|
|
1187
1017
|
return {
|
|
@@ -1270,7 +1100,9 @@ function readContext(context, observedBits) {
|
|
|
1270
1100
|
validateContextBounds(context, threadID);
|
|
1271
1101
|
|
|
1272
1102
|
{
|
|
1273
|
-
|
|
1103
|
+
if (isInHookUserCodeInDev) {
|
|
1104
|
+
error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
|
|
1105
|
+
}
|
|
1274
1106
|
}
|
|
1275
1107
|
|
|
1276
1108
|
return context[threadID];
|
|
@@ -1288,6 +1120,7 @@ function useContext(context, observedBits) {
|
|
|
1288
1120
|
}
|
|
1289
1121
|
|
|
1290
1122
|
function basicStateReducer(state, action) {
|
|
1123
|
+
// $FlowFixMe: Flow doesn't like mixed types
|
|
1291
1124
|
return typeof action === 'function' ? action(state) : action;
|
|
1292
1125
|
}
|
|
1293
1126
|
|
|
@@ -1437,19 +1270,17 @@ function useRef(initialValue) {
|
|
|
1437
1270
|
function useLayoutEffect(create, inputs) {
|
|
1438
1271
|
{
|
|
1439
1272
|
currentHookNameInDev = 'useLayoutEffect';
|
|
1440
|
-
}
|
|
1441
1273
|
|
|
1442
|
-
|
|
1274
|
+
error('useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.');
|
|
1275
|
+
}
|
|
1443
1276
|
}
|
|
1444
1277
|
|
|
1445
1278
|
function dispatchAction(componentIdentity, queue, action) {
|
|
1446
|
-
(
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
throw ReactError(Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."));
|
|
1450
|
-
}
|
|
1279
|
+
if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
1280
|
+
{
|
|
1281
|
+
throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
|
|
1451
1282
|
}
|
|
1452
|
-
}
|
|
1283
|
+
}
|
|
1453
1284
|
|
|
1454
1285
|
if (componentIdentity === currentlyRenderingComponent) {
|
|
1455
1286
|
// This is a render phase update. Stash it in a lazily-created map of
|
|
@@ -1479,9 +1310,6 @@ function dispatchAction(componentIdentity, queue, action) {
|
|
|
1479
1310
|
|
|
1480
1311
|
lastRenderPhaseUpdate.next = update;
|
|
1481
1312
|
}
|
|
1482
|
-
} else {// This means an update has happened after the function component has
|
|
1483
|
-
// returned. On the server this is a no-op. In React Fiber, the update
|
|
1484
|
-
// would be scheduled for a future render.
|
|
1485
1313
|
}
|
|
1486
1314
|
}
|
|
1487
1315
|
|
|
@@ -1497,6 +1325,21 @@ function useResponder(responder, props) {
|
|
|
1497
1325
|
};
|
|
1498
1326
|
}
|
|
1499
1327
|
|
|
1328
|
+
function useDeferredValue(value, config) {
|
|
1329
|
+
resolveCurrentlyRenderingComponent();
|
|
1330
|
+
return value;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
function useTransition(config) {
|
|
1334
|
+
resolveCurrentlyRenderingComponent();
|
|
1335
|
+
|
|
1336
|
+
var startTransition = function (callback) {
|
|
1337
|
+
callback();
|
|
1338
|
+
};
|
|
1339
|
+
|
|
1340
|
+
return [startTransition, false];
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1500
1343
|
function noop() {}
|
|
1501
1344
|
|
|
1502
1345
|
var currentThreadID = 0;
|
|
@@ -1518,7 +1361,9 @@ var Dispatcher = {
|
|
|
1518
1361
|
useEffect: noop,
|
|
1519
1362
|
// Debugging effect
|
|
1520
1363
|
useDebugValue: noop,
|
|
1521
|
-
useResponder: useResponder
|
|
1364
|
+
useResponder: useResponder,
|
|
1365
|
+
useDeferredValue: useDeferredValue,
|
|
1366
|
+
useTransition: useTransition
|
|
1522
1367
|
};
|
|
1523
1368
|
|
|
1524
1369
|
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
@@ -1557,13 +1402,13 @@ function getChildNamespace(parentNamespace, type) {
|
|
|
1557
1402
|
return parentNamespace;
|
|
1558
1403
|
}
|
|
1559
1404
|
|
|
1560
|
-
var ReactDebugCurrentFrame$
|
|
1405
|
+
var ReactDebugCurrentFrame$2 = null;
|
|
1561
1406
|
var ReactControlledValuePropTypes = {
|
|
1562
1407
|
checkPropTypes: null
|
|
1563
1408
|
};
|
|
1564
1409
|
|
|
1565
1410
|
{
|
|
1566
|
-
ReactDebugCurrentFrame$
|
|
1411
|
+
ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1567
1412
|
var hasReadOnlyValue = {
|
|
1568
1413
|
button: true,
|
|
1569
1414
|
checkbox: true,
|
|
@@ -1575,14 +1420,14 @@ var ReactControlledValuePropTypes = {
|
|
|
1575
1420
|
};
|
|
1576
1421
|
var propTypes = {
|
|
1577
1422
|
value: function (props, propName, componentName) {
|
|
1578
|
-
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null ||
|
|
1423
|
+
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
|
|
1579
1424
|
return null;
|
|
1580
1425
|
}
|
|
1581
1426
|
|
|
1582
1427
|
return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
|
1583
1428
|
},
|
|
1584
1429
|
checked: function (props, propName, componentName) {
|
|
1585
|
-
if (props.onChange || props.readOnly || props.disabled || props[propName] == null ||
|
|
1430
|
+
if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
|
|
1586
1431
|
return null;
|
|
1587
1432
|
}
|
|
1588
1433
|
|
|
@@ -1595,7 +1440,7 @@ var ReactControlledValuePropTypes = {
|
|
|
1595
1440
|
*/
|
|
1596
1441
|
|
|
1597
1442
|
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
|
1598
|
-
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$
|
|
1443
|
+
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
|
|
1599
1444
|
};
|
|
1600
1445
|
}
|
|
1601
1446
|
|
|
@@ -1626,13 +1471,11 @@ var voidElementTags = _assign({
|
|
|
1626
1471
|
menuitem: true
|
|
1627
1472
|
}, omittedCloseTags);
|
|
1628
1473
|
|
|
1629
|
-
// or add stack by default to invariants where possible.
|
|
1630
|
-
|
|
1631
1474
|
var HTML = '__html';
|
|
1632
|
-
var ReactDebugCurrentFrame$
|
|
1475
|
+
var ReactDebugCurrentFrame$3 = null;
|
|
1633
1476
|
|
|
1634
1477
|
{
|
|
1635
|
-
ReactDebugCurrentFrame$
|
|
1478
|
+
ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1636
1479
|
}
|
|
1637
1480
|
|
|
1638
1481
|
function assertValidProps(tag, props) {
|
|
@@ -1642,44 +1485,38 @@ function assertValidProps(tag, props) {
|
|
|
1642
1485
|
|
|
1643
1486
|
|
|
1644
1487
|
if (voidElementTags[tag]) {
|
|
1645
|
-
(
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
throw ReactError(Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$4.getStackAddendum())));
|
|
1649
|
-
}
|
|
1488
|
+
if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
|
|
1489
|
+
{
|
|
1490
|
+
throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
|
|
1650
1491
|
}
|
|
1651
|
-
}
|
|
1492
|
+
}
|
|
1652
1493
|
}
|
|
1653
1494
|
|
|
1654
1495
|
if (props.dangerouslySetInnerHTML != null) {
|
|
1655
|
-
(
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
throw ReactError(Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."));
|
|
1659
|
-
}
|
|
1496
|
+
if (!(props.children == null)) {
|
|
1497
|
+
{
|
|
1498
|
+
throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
|
|
1660
1499
|
}
|
|
1661
|
-
}
|
|
1500
|
+
}
|
|
1662
1501
|
|
|
1663
|
-
(
|
|
1664
|
-
|
|
1665
|
-
{
|
|
1666
|
-
throw ReactError(Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information."));
|
|
1667
|
-
}
|
|
1502
|
+
if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
|
|
1503
|
+
{
|
|
1504
|
+
throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." );
|
|
1668
1505
|
}
|
|
1669
|
-
}
|
|
1506
|
+
}
|
|
1670
1507
|
}
|
|
1671
1508
|
|
|
1672
1509
|
{
|
|
1673
|
-
!
|
|
1510
|
+
if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
|
|
1511
|
+
error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
|
|
1512
|
+
}
|
|
1674
1513
|
}
|
|
1675
1514
|
|
|
1676
|
-
(
|
|
1677
|
-
|
|
1678
|
-
{
|
|
1679
|
-
throw ReactError(Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + (ReactDebugCurrentFrame$4.getStackAddendum())));
|
|
1680
|
-
}
|
|
1515
|
+
if (!(props.style == null || typeof props.style === 'object')) {
|
|
1516
|
+
{
|
|
1517
|
+
throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
|
|
1681
1518
|
}
|
|
1682
|
-
}
|
|
1519
|
+
}
|
|
1683
1520
|
}
|
|
1684
1521
|
|
|
1685
1522
|
/**
|
|
@@ -1859,7 +1696,8 @@ var warnValidStyle = function () {};
|
|
|
1859
1696
|
}
|
|
1860
1697
|
|
|
1861
1698
|
warnedStyleNames[name] = true;
|
|
1862
|
-
|
|
1699
|
+
|
|
1700
|
+
error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
|
|
1863
1701
|
// (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
1864
1702
|
// is converted to lowercase `ms`.
|
|
1865
1703
|
camelize(name.replace(msPattern$1, 'ms-')));
|
|
@@ -1871,7 +1709,8 @@ var warnValidStyle = function () {};
|
|
|
1871
1709
|
}
|
|
1872
1710
|
|
|
1873
1711
|
warnedStyleNames[name] = true;
|
|
1874
|
-
|
|
1712
|
+
|
|
1713
|
+
error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
1875
1714
|
};
|
|
1876
1715
|
|
|
1877
1716
|
var warnStyleValueWithSemicolon = function (name, value) {
|
|
@@ -1880,7 +1719,8 @@ var warnValidStyle = function () {};
|
|
|
1880
1719
|
}
|
|
1881
1720
|
|
|
1882
1721
|
warnedStyleValues[value] = true;
|
|
1883
|
-
|
|
1722
|
+
|
|
1723
|
+
error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
|
1884
1724
|
};
|
|
1885
1725
|
|
|
1886
1726
|
var warnStyleValueIsNaN = function (name, value) {
|
|
@@ -1889,7 +1729,8 @@ var warnValidStyle = function () {};
|
|
|
1889
1729
|
}
|
|
1890
1730
|
|
|
1891
1731
|
warnedForNaNValue = true;
|
|
1892
|
-
|
|
1732
|
+
|
|
1733
|
+
error('`NaN` is an invalid value for the `%s` css style property.', name);
|
|
1893
1734
|
};
|
|
1894
1735
|
|
|
1895
1736
|
var warnStyleValueIsInfinity = function (name, value) {
|
|
@@ -1898,7 +1739,8 @@ var warnValidStyle = function () {};
|
|
|
1898
1739
|
}
|
|
1899
1740
|
|
|
1900
1741
|
warnedForInfinityValue = true;
|
|
1901
|
-
|
|
1742
|
+
|
|
1743
|
+
error('`Infinity` is an invalid value for the `%s` css style property.', name);
|
|
1902
1744
|
};
|
|
1903
1745
|
|
|
1904
1746
|
warnValidStyle = function (name, value) {
|
|
@@ -1984,47 +1826,52 @@ var ariaProperties = {
|
|
|
1984
1826
|
var warnedProperties = {};
|
|
1985
1827
|
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1986
1828
|
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1987
|
-
var hasOwnProperty$
|
|
1829
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1988
1830
|
|
|
1989
1831
|
function validateProperty(tagName, name) {
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1832
|
+
{
|
|
1833
|
+
if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
|
|
1834
|
+
return true;
|
|
1835
|
+
}
|
|
1993
1836
|
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1837
|
+
if (rARIACamel.test(name)) {
|
|
1838
|
+
var ariaName = 'aria-' + name.slice(4).toLowerCase();
|
|
1839
|
+
var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
|
|
1840
|
+
// DOM properties, then it is an invalid aria-* attribute.
|
|
1998
1841
|
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1842
|
+
if (correctName == null) {
|
|
1843
|
+
error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
|
1844
|
+
|
|
1845
|
+
warnedProperties[name] = true;
|
|
1846
|
+
return true;
|
|
1847
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
2004
1848
|
|
|
2005
1849
|
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1850
|
+
if (name !== correctName) {
|
|
1851
|
+
error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
|
1852
|
+
|
|
1853
|
+
warnedProperties[name] = true;
|
|
1854
|
+
return true;
|
|
1855
|
+
}
|
|
2010
1856
|
}
|
|
2011
|
-
}
|
|
2012
1857
|
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
1858
|
+
if (rARIA.test(name)) {
|
|
1859
|
+
var lowerCasedName = name.toLowerCase();
|
|
1860
|
+
var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
|
|
1861
|
+
// DOM properties, then it is an invalid aria-* attribute.
|
|
2017
1862
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
1863
|
+
if (standardName == null) {
|
|
1864
|
+
warnedProperties[name] = true;
|
|
1865
|
+
return false;
|
|
1866
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
2022
1867
|
|
|
2023
1868
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1869
|
+
if (name !== standardName) {
|
|
1870
|
+
error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
|
1871
|
+
|
|
1872
|
+
warnedProperties[name] = true;
|
|
1873
|
+
return true;
|
|
1874
|
+
}
|
|
2028
1875
|
}
|
|
2029
1876
|
}
|
|
2030
1877
|
|
|
@@ -2032,24 +1879,26 @@ function validateProperty(tagName, name) {
|
|
|
2032
1879
|
}
|
|
2033
1880
|
|
|
2034
1881
|
function warnInvalidARIAProps(type, props) {
|
|
2035
|
-
|
|
1882
|
+
{
|
|
1883
|
+
var invalidProps = [];
|
|
2036
1884
|
|
|
2037
|
-
|
|
2038
|
-
|
|
1885
|
+
for (var key in props) {
|
|
1886
|
+
var isValid = validateProperty(type, key);
|
|
2039
1887
|
|
|
2040
|
-
|
|
2041
|
-
|
|
1888
|
+
if (!isValid) {
|
|
1889
|
+
invalidProps.push(key);
|
|
1890
|
+
}
|
|
2042
1891
|
}
|
|
2043
|
-
}
|
|
2044
1892
|
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
1893
|
+
var unknownPropString = invalidProps.map(function (prop) {
|
|
1894
|
+
return '`' + prop + '`';
|
|
1895
|
+
}).join(', ');
|
|
2048
1896
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
1897
|
+
if (invalidProps.length === 1) {
|
|
1898
|
+
error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1899
|
+
} else if (invalidProps.length > 1) {
|
|
1900
|
+
error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1901
|
+
}
|
|
2053
1902
|
}
|
|
2054
1903
|
}
|
|
2055
1904
|
|
|
@@ -2063,48 +1912,28 @@ function validateProperties(type, props) {
|
|
|
2063
1912
|
|
|
2064
1913
|
var didWarnValueNull = false;
|
|
2065
1914
|
function validateProperties$1(type, props) {
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
1915
|
+
{
|
|
1916
|
+
if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
2069
1919
|
|
|
2070
|
-
|
|
2071
|
-
|
|
1920
|
+
if (props != null && props.value === null && !didWarnValueNull) {
|
|
1921
|
+
didWarnValueNull = true;
|
|
2072
1922
|
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
1923
|
+
if (type === 'select' && props.multiple) {
|
|
1924
|
+
error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
|
|
1925
|
+
} else {
|
|
1926
|
+
error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
|
|
1927
|
+
}
|
|
2077
1928
|
}
|
|
2078
1929
|
}
|
|
2079
1930
|
}
|
|
2080
1931
|
|
|
2081
|
-
/**
|
|
2082
|
-
* Registers plugins so that they can extract and dispatch events.
|
|
2083
|
-
*
|
|
2084
|
-
* @see {EventPluginHub}
|
|
2085
|
-
*/
|
|
2086
|
-
|
|
2087
|
-
/**
|
|
2088
|
-
* Ordered list of injected plugins.
|
|
2089
|
-
*/
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
/**
|
|
2094
|
-
* Mapping from event name to dispatch config
|
|
2095
|
-
*/
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
1932
|
/**
|
|
2099
1933
|
* Mapping from registration name to plugin module
|
|
2100
1934
|
*/
|
|
2101
1935
|
|
|
2102
1936
|
var registrationNameModules = {};
|
|
2103
|
-
/**
|
|
2104
|
-
* Mapping from registration name to event name
|
|
2105
|
-
*/
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
1937
|
/**
|
|
2109
1938
|
* Mapping from lowercase registration names to the properly cased version,
|
|
2110
1939
|
* used to warn in the case of missing event handlers. Available
|
|
@@ -2112,29 +1941,7 @@ var registrationNameModules = {};
|
|
|
2112
1941
|
* @type {Object}
|
|
2113
1942
|
*/
|
|
2114
1943
|
|
|
2115
|
-
var possibleRegistrationNames =
|
|
2116
|
-
|
|
2117
|
-
/**
|
|
2118
|
-
* Injects an ordering of plugins (by plugin name). This allows the ordering
|
|
2119
|
-
* to be decoupled from injection of the actual plugins so that ordering is
|
|
2120
|
-
* always deterministic regardless of packaging, on-the-fly injection, etc.
|
|
2121
|
-
*
|
|
2122
|
-
* @param {array} InjectedEventPluginOrder
|
|
2123
|
-
* @internal
|
|
2124
|
-
* @see {EventPluginHub.injection.injectEventPluginOrder}
|
|
2125
|
-
*/
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
/**
|
|
2129
|
-
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
|
|
2130
|
-
* in the ordering injected by `injectEventPluginOrder`.
|
|
2131
|
-
*
|
|
2132
|
-
* Plugins can be injected as part of page initialization or on-the-fly.
|
|
2133
|
-
*
|
|
2134
|
-
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
|
|
2135
|
-
* @internal
|
|
2136
|
-
* @see {EventPluginHub.injection.injectEventPluginsByName}
|
|
2137
|
-
*/
|
|
1944
|
+
var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true
|
|
2138
1945
|
|
|
2139
1946
|
// When adding attributes to the HTML or SVG whitelist, be sure to
|
|
2140
1947
|
// also add them to this module to ensure casing and incorrect name
|
|
@@ -2643,7 +2450,8 @@ var validateProperty$1 = function () {};
|
|
|
2643
2450
|
var lowerCasedName = name.toLowerCase();
|
|
2644
2451
|
|
|
2645
2452
|
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
2646
|
-
|
|
2453
|
+
error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
|
|
2454
|
+
|
|
2647
2455
|
warnedProperties$1[name] = true;
|
|
2648
2456
|
return true;
|
|
2649
2457
|
} // We can't rely on the event system being injected on the server.
|
|
@@ -2657,13 +2465,15 @@ var validateProperty$1 = function () {};
|
|
|
2657
2465
|
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
|
2658
2466
|
|
|
2659
2467
|
if (registrationName != null) {
|
|
2660
|
-
|
|
2468
|
+
error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
|
2469
|
+
|
|
2661
2470
|
warnedProperties$1[name] = true;
|
|
2662
2471
|
return true;
|
|
2663
2472
|
}
|
|
2664
2473
|
|
|
2665
2474
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
2666
|
-
|
|
2475
|
+
error('Unknown event handler property `%s`. It will be ignored.', name);
|
|
2476
|
+
|
|
2667
2477
|
warnedProperties$1[name] = true;
|
|
2668
2478
|
return true;
|
|
2669
2479
|
}
|
|
@@ -2672,7 +2482,7 @@ var validateProperty$1 = function () {};
|
|
|
2672
2482
|
// So we can't tell if the event name is correct for sure, but we can filter
|
|
2673
2483
|
// out known bad ones like `onclick`. We can't suggest a specific replacement though.
|
|
2674
2484
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
2675
|
-
|
|
2485
|
+
error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
|
2676
2486
|
}
|
|
2677
2487
|
|
|
2678
2488
|
warnedProperties$1[name] = true;
|
|
@@ -2685,25 +2495,29 @@ var validateProperty$1 = function () {};
|
|
|
2685
2495
|
}
|
|
2686
2496
|
|
|
2687
2497
|
if (lowerCasedName === 'innerhtml') {
|
|
2688
|
-
|
|
2498
|
+
error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
2499
|
+
|
|
2689
2500
|
warnedProperties$1[name] = true;
|
|
2690
2501
|
return true;
|
|
2691
2502
|
}
|
|
2692
2503
|
|
|
2693
2504
|
if (lowerCasedName === 'aria') {
|
|
2694
|
-
|
|
2505
|
+
error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
2506
|
+
|
|
2695
2507
|
warnedProperties$1[name] = true;
|
|
2696
2508
|
return true;
|
|
2697
2509
|
}
|
|
2698
2510
|
|
|
2699
2511
|
if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
|
2700
|
-
|
|
2512
|
+
error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
|
2513
|
+
|
|
2701
2514
|
warnedProperties$1[name] = true;
|
|
2702
2515
|
return true;
|
|
2703
2516
|
}
|
|
2704
2517
|
|
|
2705
2518
|
if (typeof value === 'number' && isNaN(value)) {
|
|
2706
|
-
|
|
2519
|
+
error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
|
2520
|
+
|
|
2707
2521
|
warnedProperties$1[name] = true;
|
|
2708
2522
|
return true;
|
|
2709
2523
|
}
|
|
@@ -2715,23 +2529,25 @@ var validateProperty$1 = function () {};
|
|
|
2715
2529
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
2716
2530
|
|
|
2717
2531
|
if (standardName !== name) {
|
|
2718
|
-
|
|
2532
|
+
error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
|
2533
|
+
|
|
2719
2534
|
warnedProperties$1[name] = true;
|
|
2720
2535
|
return true;
|
|
2721
2536
|
}
|
|
2722
2537
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
2723
2538
|
// Unknown attributes should have lowercase casing since that's how they
|
|
2724
2539
|
// will be cased anyway with server rendering.
|
|
2725
|
-
|
|
2540
|
+
error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
|
|
2541
|
+
|
|
2726
2542
|
warnedProperties$1[name] = true;
|
|
2727
2543
|
return true;
|
|
2728
2544
|
}
|
|
2729
2545
|
|
|
2730
2546
|
if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
2731
2547
|
if (value) {
|
|
2732
|
-
|
|
2548
|
+
error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
|
|
2733
2549
|
} else {
|
|
2734
|
-
|
|
2550
|
+
error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
|
|
2735
2551
|
}
|
|
2736
2552
|
|
|
2737
2553
|
warnedProperties$1[name] = true;
|
|
@@ -2752,7 +2568,8 @@ var validateProperty$1 = function () {};
|
|
|
2752
2568
|
|
|
2753
2569
|
|
|
2754
2570
|
if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
2755
|
-
|
|
2571
|
+
error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
|
|
2572
|
+
|
|
2756
2573
|
warnedProperties$1[name] = true;
|
|
2757
2574
|
return true;
|
|
2758
2575
|
}
|
|
@@ -2762,24 +2579,26 @@ var validateProperty$1 = function () {};
|
|
|
2762
2579
|
}
|
|
2763
2580
|
|
|
2764
2581
|
var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
|
2765
|
-
|
|
2582
|
+
{
|
|
2583
|
+
var unknownProps = [];
|
|
2766
2584
|
|
|
2767
|
-
|
|
2768
|
-
|
|
2585
|
+
for (var key in props) {
|
|
2586
|
+
var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
|
2769
2587
|
|
|
2770
|
-
|
|
2771
|
-
|
|
2588
|
+
if (!isValid) {
|
|
2589
|
+
unknownProps.push(key);
|
|
2590
|
+
}
|
|
2772
2591
|
}
|
|
2773
|
-
}
|
|
2774
2592
|
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2593
|
+
var unknownPropString = unknownProps.map(function (prop) {
|
|
2594
|
+
return '`' + prop + '`';
|
|
2595
|
+
}).join(', ');
|
|
2778
2596
|
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2597
|
+
if (unknownProps.length === 1) {
|
|
2598
|
+
error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
|
2599
|
+
} else if (unknownProps.length > 1) {
|
|
2600
|
+
error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
|
2601
|
+
}
|
|
2783
2602
|
}
|
|
2784
2603
|
};
|
|
2785
2604
|
|
|
@@ -2798,7 +2617,7 @@ var toArray = React.Children.toArray; // This is only used in DEV.
|
|
|
2798
2617
|
|
|
2799
2618
|
var currentDebugStacks = [];
|
|
2800
2619
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2801
|
-
var ReactDebugCurrentFrame;
|
|
2620
|
+
var ReactDebugCurrentFrame$4;
|
|
2802
2621
|
var prevGetCurrentStackImpl = null;
|
|
2803
2622
|
|
|
2804
2623
|
var getCurrentServerStackImpl = function () {
|
|
@@ -2820,7 +2639,7 @@ var popCurrentDebugStack = function () {};
|
|
|
2820
2639
|
var hasWarnedAboutUsingContextAsConsumer = false;
|
|
2821
2640
|
|
|
2822
2641
|
{
|
|
2823
|
-
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2642
|
+
ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2824
2643
|
|
|
2825
2644
|
validatePropertiesInDevelopment = function (type, props) {
|
|
2826
2645
|
validateProperties(type, props);
|
|
@@ -2844,8 +2663,8 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2844
2663
|
if (currentDebugStacks.length === 1) {
|
|
2845
2664
|
// We are entering a server renderer.
|
|
2846
2665
|
// Remember the previous (e.g. client) global stack implementation.
|
|
2847
|
-
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
|
2848
|
-
ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
|
2666
|
+
prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack;
|
|
2667
|
+
ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl;
|
|
2849
2668
|
}
|
|
2850
2669
|
};
|
|
2851
2670
|
|
|
@@ -2866,7 +2685,7 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2866
2685
|
if (currentDebugStacks.length === 0) {
|
|
2867
2686
|
// We are exiting the server renderer.
|
|
2868
2687
|
// Restore the previous (e.g. client) global stack implementation.
|
|
2869
|
-
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
|
2688
|
+
ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl;
|
|
2870
2689
|
prevGetCurrentStackImpl = null;
|
|
2871
2690
|
}
|
|
2872
2691
|
};
|
|
@@ -2924,13 +2743,11 @@ var validatedTagCache = {};
|
|
|
2924
2743
|
|
|
2925
2744
|
function validateDangerousTag(tag) {
|
|
2926
2745
|
if (!validatedTagCache.hasOwnProperty(tag)) {
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
throw ReactError(Error("Invalid tag: " + tag));
|
|
2931
|
-
}
|
|
2746
|
+
if (!VALID_TAG_REGEX.test(tag)) {
|
|
2747
|
+
{
|
|
2748
|
+
throw Error( "Invalid tag: " + tag );
|
|
2932
2749
|
}
|
|
2933
|
-
}
|
|
2750
|
+
}
|
|
2934
2751
|
|
|
2935
2752
|
validatedTagCache[tag] = true;
|
|
2936
2753
|
}
|
|
@@ -2986,7 +2803,8 @@ function warnNoop(publicInstance, callerName) {
|
|
|
2986
2803
|
return;
|
|
2987
2804
|
}
|
|
2988
2805
|
|
|
2989
|
-
|
|
2806
|
+
error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
|
|
2807
|
+
|
|
2990
2808
|
didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
|
2991
2809
|
}
|
|
2992
2810
|
}
|
|
@@ -3052,14 +2870,15 @@ function flattenOptionChildren(children) {
|
|
|
3052
2870
|
{
|
|
3053
2871
|
if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
|
3054
2872
|
didWarnInvalidOptionChildren = true;
|
|
3055
|
-
|
|
2873
|
+
|
|
2874
|
+
error('Only strings and numbers are supported as <option> children.');
|
|
3056
2875
|
}
|
|
3057
2876
|
}
|
|
3058
2877
|
});
|
|
3059
2878
|
return content;
|
|
3060
2879
|
}
|
|
3061
2880
|
|
|
3062
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2881
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
3063
2882
|
var STYLE = 'style';
|
|
3064
2883
|
var RESERVED_PROPS = {
|
|
3065
2884
|
children: null,
|
|
@@ -3072,11 +2891,7 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
3072
2891
|
var ret = '<' + tagVerbatim;
|
|
3073
2892
|
|
|
3074
2893
|
for (var propKey in props) {
|
|
3075
|
-
if (!hasOwnProperty.call(props, propKey)) {
|
|
3076
|
-
continue;
|
|
3077
|
-
}
|
|
3078
|
-
|
|
3079
|
-
if (enableFlareAPI && propKey === 'listeners') {
|
|
2894
|
+
if (!hasOwnProperty$2.call(props, propKey)) {
|
|
3080
2895
|
continue;
|
|
3081
2896
|
}
|
|
3082
2897
|
|
|
@@ -3120,13 +2935,11 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
3120
2935
|
|
|
3121
2936
|
function validateRenderResult(child, type) {
|
|
3122
2937
|
if (child === undefined) {
|
|
3123
|
-
|
|
2938
|
+
{
|
|
3124
2939
|
{
|
|
3125
|
-
|
|
3126
|
-
throw ReactError(Error((getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."));
|
|
3127
|
-
}
|
|
2940
|
+
throw Error( (getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
|
|
3128
2941
|
}
|
|
3129
|
-
}
|
|
2942
|
+
}
|
|
3130
2943
|
}
|
|
3131
2944
|
}
|
|
3132
2945
|
|
|
@@ -3187,7 +3000,8 @@ function resolve(child, context, threadID) {
|
|
|
3187
3000
|
var componentName = getComponentName(Component) || 'Unknown';
|
|
3188
3001
|
|
|
3189
3002
|
if (!didWarnAboutUninitializedState[componentName]) {
|
|
3190
|
-
|
|
3003
|
+
error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
|
|
3004
|
+
|
|
3191
3005
|
didWarnAboutUninitializedState[componentName] = true;
|
|
3192
3006
|
}
|
|
3193
3007
|
}
|
|
@@ -3200,7 +3014,8 @@ function resolve(child, context, threadID) {
|
|
|
3200
3014
|
var _componentName = getComponentName(Component) || 'Unknown';
|
|
3201
3015
|
|
|
3202
3016
|
if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
|
3203
|
-
|
|
3017
|
+
error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
|
3018
|
+
|
|
3204
3019
|
didWarnAboutUndefinedDerivedState[_componentName] = true;
|
|
3205
3020
|
}
|
|
3206
3021
|
}
|
|
@@ -3216,7 +3031,8 @@ function resolve(child, context, threadID) {
|
|
|
3216
3031
|
var _componentName2 = getComponentName(Component) || 'Unknown';
|
|
3217
3032
|
|
|
3218
3033
|
if (!didWarnAboutBadClass[_componentName2]) {
|
|
3219
|
-
|
|
3034
|
+
error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
|
|
3035
|
+
|
|
3220
3036
|
didWarnAboutBadClass[_componentName2] = true;
|
|
3221
3037
|
}
|
|
3222
3038
|
}
|
|
@@ -3237,7 +3053,8 @@ function resolve(child, context, threadID) {
|
|
|
3237
3053
|
var _componentName3 = getComponentName(Component) || 'Unknown';
|
|
3238
3054
|
|
|
3239
3055
|
if (!didWarnAboutModulePatternComponent[_componentName3]) {
|
|
3240
|
-
|
|
3056
|
+
error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName3, _componentName3, _componentName3);
|
|
3057
|
+
|
|
3241
3058
|
didWarnAboutModulePatternComponent[_componentName3] = true;
|
|
3242
3059
|
}
|
|
3243
3060
|
}
|
|
@@ -3255,12 +3072,13 @@ function resolve(child, context, threadID) {
|
|
|
3255
3072
|
if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
|
3256
3073
|
if (typeof inst.componentWillMount === 'function') {
|
|
3257
3074
|
{
|
|
3258
|
-
if (
|
|
3075
|
+
if ( inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
3259
3076
|
var _componentName4 = getComponentName(Component) || 'Unknown';
|
|
3260
3077
|
|
|
3261
3078
|
if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
|
|
3262
|
-
|
|
3079
|
+
warn( // keep this warning in sync with ReactStrictModeWarning.js
|
|
3263
3080
|
'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\n' + '\nPlease update the following components: %s', _componentName4);
|
|
3081
|
+
|
|
3264
3082
|
didWarnAboutDeprecatedWillMount[_componentName4] = true;
|
|
3265
3083
|
}
|
|
3266
3084
|
}
|
|
@@ -3326,15 +3144,7 @@ function resolve(child, context, threadID) {
|
|
|
3326
3144
|
validateRenderResult(child, Component);
|
|
3327
3145
|
var childContext;
|
|
3328
3146
|
|
|
3329
|
-
|
|
3330
|
-
{
|
|
3331
|
-
var childContextTypes = Component.childContextTypes;
|
|
3332
|
-
|
|
3333
|
-
if (childContextTypes !== undefined) {
|
|
3334
|
-
warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
|
|
3335
|
-
}
|
|
3336
|
-
}
|
|
3337
|
-
} else {
|
|
3147
|
+
{
|
|
3338
3148
|
if (typeof inst.getChildContext === 'function') {
|
|
3339
3149
|
var _childContextTypes = Component.childContextTypes;
|
|
3340
3150
|
|
|
@@ -3342,16 +3152,16 @@ function resolve(child, context, threadID) {
|
|
|
3342
3152
|
childContext = inst.getChildContext();
|
|
3343
3153
|
|
|
3344
3154
|
for (var contextKey in childContext) {
|
|
3345
|
-
(
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
throw ReactError(Error((getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes."));
|
|
3349
|
-
}
|
|
3155
|
+
if (!(contextKey in _childContextTypes)) {
|
|
3156
|
+
{
|
|
3157
|
+
throw Error( (getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
|
|
3350
3158
|
}
|
|
3351
|
-
}
|
|
3159
|
+
}
|
|
3352
3160
|
}
|
|
3353
3161
|
} else {
|
|
3354
|
-
|
|
3162
|
+
{
|
|
3163
|
+
error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
|
3164
|
+
}
|
|
3355
3165
|
}
|
|
3356
3166
|
}
|
|
3357
3167
|
|
|
@@ -3449,7 +3259,9 @@ function () {
|
|
|
3449
3259
|
var index = this.contextIndex;
|
|
3450
3260
|
|
|
3451
3261
|
{
|
|
3452
|
-
|
|
3262
|
+
if (index < 0 || provider !== this.contextProviderStack[index]) {
|
|
3263
|
+
error('Unexpected pop.');
|
|
3264
|
+
}
|
|
3453
3265
|
}
|
|
3454
3266
|
|
|
3455
3267
|
var context = this.contextStack[index];
|
|
@@ -3481,8 +3293,6 @@ function () {
|
|
|
3481
3293
|
};
|
|
3482
3294
|
|
|
3483
3295
|
_proto.read = function read(bytes) {
|
|
3484
|
-
var _this = this;
|
|
3485
|
-
|
|
3486
3296
|
if (this.exhausted) {
|
|
3487
3297
|
return null;
|
|
3488
3298
|
}
|
|
@@ -3530,13 +3340,11 @@ function () {
|
|
|
3530
3340
|
|
|
3531
3341
|
var fallbackFrame = frame.fallbackFrame;
|
|
3532
3342
|
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
throw ReactError(Error("ReactDOMServer did not find an internal fallback frame for Suspense. This is a bug in React. Please file an issue."));
|
|
3537
|
-
}
|
|
3343
|
+
if (!fallbackFrame) {
|
|
3344
|
+
{
|
|
3345
|
+
throw Error(true ? "ReactDOMServer did not find an internal fallback frame for Suspense. This is a bug in React. Please file an issue." : formatProdErrorMessage(303));
|
|
3538
3346
|
}
|
|
3539
|
-
}
|
|
3347
|
+
}
|
|
3540
3348
|
|
|
3541
3349
|
this.stack.push(fallbackFrame);
|
|
3542
3350
|
out[this.suspenseDepth] += '<!--$!-->'; // Skip flushing output since we're switching to the fallback
|
|
@@ -3555,7 +3363,7 @@ function () {
|
|
|
3555
3363
|
var child = frame.children[frame.childIndex++];
|
|
3556
3364
|
var outBuffer = '';
|
|
3557
3365
|
|
|
3558
|
-
{
|
|
3366
|
+
if (true) {
|
|
3559
3367
|
pushCurrentDebugStack(this.stack); // We're starting work on this frame, so reset its inner stack.
|
|
3560
3368
|
|
|
3561
3369
|
frame.debugElementStack.length = 0;
|
|
@@ -3566,29 +3374,25 @@ function () {
|
|
|
3566
3374
|
} catch (err) {
|
|
3567
3375
|
if (err != null && typeof err.then === 'function') {
|
|
3568
3376
|
if (enableSuspenseServerRenderer) {
|
|
3569
|
-
(
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
throw ReactError(Error("A React component suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."));
|
|
3573
|
-
}
|
|
3377
|
+
if (!(this.suspenseDepth > 0)) {
|
|
3378
|
+
{
|
|
3379
|
+
throw Error(true ? "A React component suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." : formatProdErrorMessage(342));
|
|
3574
3380
|
}
|
|
3575
|
-
}
|
|
3381
|
+
}
|
|
3576
3382
|
|
|
3577
3383
|
suspended = true;
|
|
3578
3384
|
} else {
|
|
3579
|
-
|
|
3385
|
+
if (!false) {
|
|
3580
3386
|
{
|
|
3581
|
-
|
|
3582
|
-
throw ReactError(Error("ReactDOMServer does not yet support Suspense."));
|
|
3583
|
-
}
|
|
3387
|
+
throw Error(true ? "ReactDOMServer does not yet support Suspense." : formatProdErrorMessage(294));
|
|
3584
3388
|
}
|
|
3585
|
-
}
|
|
3389
|
+
}
|
|
3586
3390
|
}
|
|
3587
3391
|
} else {
|
|
3588
3392
|
throw err;
|
|
3589
3393
|
}
|
|
3590
3394
|
} finally {
|
|
3591
|
-
{
|
|
3395
|
+
if (true) {
|
|
3592
3396
|
popCurrentDebugStack();
|
|
3593
3397
|
}
|
|
3594
3398
|
}
|
|
@@ -3640,22 +3444,18 @@ function () {
|
|
|
3640
3444
|
// Catch unexpected special types early.
|
|
3641
3445
|
var $$typeof = nextChild.$$typeof;
|
|
3642
3446
|
|
|
3643
|
-
(
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
throw ReactError(Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render."));
|
|
3647
|
-
}
|
|
3447
|
+
if (!($$typeof !== REACT_PORTAL_TYPE)) {
|
|
3448
|
+
{
|
|
3449
|
+
throw Error( "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render." );
|
|
3648
3450
|
}
|
|
3649
|
-
}
|
|
3451
|
+
} // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
|
|
3650
3452
|
|
|
3651
3453
|
|
|
3652
|
-
|
|
3454
|
+
{
|
|
3653
3455
|
{
|
|
3654
|
-
|
|
3655
|
-
throw ReactError(Error("Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue."));
|
|
3656
|
-
}
|
|
3456
|
+
throw Error( "Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue." );
|
|
3657
3457
|
}
|
|
3658
|
-
}
|
|
3458
|
+
}
|
|
3659
3459
|
}
|
|
3660
3460
|
|
|
3661
3461
|
var nextChildren = toArray(nextChild);
|
|
@@ -3712,74 +3512,14 @@ function () {
|
|
|
3712
3512
|
|
|
3713
3513
|
case REACT_SUSPENSE_TYPE:
|
|
3714
3514
|
{
|
|
3715
|
-
|
|
3716
|
-
var fallback = nextChild.props.fallback;
|
|
3717
|
-
|
|
3718
|
-
if (fallback === undefined) {
|
|
3719
|
-
// If there is no fallback, then this just behaves as a fragment.
|
|
3720
|
-
var _nextChildren3 = toArray(nextChild.props.children);
|
|
3721
|
-
|
|
3722
|
-
var _frame3 = {
|
|
3723
|
-
type: null,
|
|
3724
|
-
domNamespace: parentNamespace,
|
|
3725
|
-
children: _nextChildren3,
|
|
3726
|
-
childIndex: 0,
|
|
3727
|
-
context: context,
|
|
3728
|
-
footer: ''
|
|
3729
|
-
};
|
|
3730
|
-
|
|
3731
|
-
{
|
|
3732
|
-
_frame3.debugElementStack = [];
|
|
3733
|
-
}
|
|
3734
|
-
|
|
3735
|
-
this.stack.push(_frame3);
|
|
3736
|
-
return '';
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
|
-
var fallbackChildren = toArray(fallback);
|
|
3740
|
-
|
|
3741
|
-
var _nextChildren2 = toArray(nextChild.props.children);
|
|
3742
|
-
|
|
3743
|
-
var fallbackFrame = {
|
|
3744
|
-
type: null,
|
|
3745
|
-
domNamespace: parentNamespace,
|
|
3746
|
-
children: fallbackChildren,
|
|
3747
|
-
childIndex: 0,
|
|
3748
|
-
context: context,
|
|
3749
|
-
footer: '<!--/$-->'
|
|
3750
|
-
};
|
|
3751
|
-
var _frame2 = {
|
|
3752
|
-
fallbackFrame: fallbackFrame,
|
|
3753
|
-
type: REACT_SUSPENSE_TYPE,
|
|
3754
|
-
domNamespace: parentNamespace,
|
|
3755
|
-
children: _nextChildren2,
|
|
3756
|
-
childIndex: 0,
|
|
3757
|
-
context: context,
|
|
3758
|
-
footer: '<!--/$-->'
|
|
3759
|
-
};
|
|
3760
|
-
|
|
3515
|
+
{
|
|
3761
3516
|
{
|
|
3762
|
-
_frame2.debugElementStack = [];
|
|
3763
|
-
fallbackFrame.debugElementStack = [];
|
|
3764
|
-
}
|
|
3765
|
-
|
|
3766
|
-
this.stack.push(_frame2);
|
|
3767
|
-
this.suspenseDepth++;
|
|
3768
|
-
return '<!--$-->';
|
|
3769
|
-
} else {
|
|
3770
|
-
(function () {
|
|
3771
3517
|
{
|
|
3772
|
-
|
|
3773
|
-
throw ReactError(Error("ReactDOMServer does not yet support Suspense."));
|
|
3774
|
-
}
|
|
3518
|
+
throw Error( "ReactDOMServer does not yet support Suspense." );
|
|
3775
3519
|
}
|
|
3776
|
-
}
|
|
3520
|
+
}
|
|
3777
3521
|
}
|
|
3778
3522
|
}
|
|
3779
|
-
// eslint-disable-next-line-no-fallthrough
|
|
3780
|
-
|
|
3781
|
-
default:
|
|
3782
|
-
break;
|
|
3783
3523
|
}
|
|
3784
3524
|
|
|
3785
3525
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
@@ -3878,7 +3618,8 @@ function () {
|
|
|
3878
3618
|
if (reactContext !== reactContext.Consumer) {
|
|
3879
3619
|
if (!hasWarnedAboutUsingContextAsConsumer) {
|
|
3880
3620
|
hasWarnedAboutUsingContextAsConsumer = true;
|
|
3881
|
-
|
|
3621
|
+
|
|
3622
|
+
error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
3882
3623
|
}
|
|
3883
3624
|
}
|
|
3884
3625
|
} else {
|
|
@@ -3913,38 +3654,12 @@ function () {
|
|
|
3913
3654
|
|
|
3914
3655
|
case REACT_FUNDAMENTAL_TYPE:
|
|
3915
3656
|
{
|
|
3916
|
-
if (enableFundamentalAPI) {
|
|
3917
|
-
var fundamentalImpl = elementType.impl;
|
|
3918
|
-
var open = fundamentalImpl.getServerSideString(null, nextElement.props);
|
|
3919
|
-
var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
|
|
3920
|
-
var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
|
|
3921
|
-
|
|
3922
|
-
var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
|
|
3923
|
-
|
|
3924
|
-
var _frame8 = {
|
|
3925
|
-
type: null,
|
|
3926
|
-
domNamespace: parentNamespace,
|
|
3927
|
-
children: _nextChildren8,
|
|
3928
|
-
childIndex: 0,
|
|
3929
|
-
context: context,
|
|
3930
|
-
footer: close
|
|
3931
|
-
};
|
|
3932
3657
|
|
|
3658
|
+
{
|
|
3933
3659
|
{
|
|
3934
|
-
|
|
3660
|
+
throw Error( "ReactDOMServer does not yet support the fundamental API." );
|
|
3935
3661
|
}
|
|
3936
|
-
|
|
3937
|
-
this.stack.push(_frame8);
|
|
3938
|
-
return open;
|
|
3939
3662
|
}
|
|
3940
|
-
|
|
3941
|
-
(function () {
|
|
3942
|
-
{
|
|
3943
|
-
{
|
|
3944
|
-
throw ReactError(Error("ReactDOMServer does not yet support the fundamental API."));
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
})();
|
|
3948
3663
|
}
|
|
3949
3664
|
// eslint-disable-next-line-no-fallthrough
|
|
3950
3665
|
|
|
@@ -3985,13 +3700,11 @@ function () {
|
|
|
3985
3700
|
|
|
3986
3701
|
case Pending:
|
|
3987
3702
|
default:
|
|
3988
|
-
|
|
3703
|
+
{
|
|
3989
3704
|
{
|
|
3990
|
-
|
|
3991
|
-
throw ReactError(Error("ReactDOMServer does not yet support lazy-loaded components."));
|
|
3992
|
-
}
|
|
3705
|
+
throw Error( "ReactDOMServer does not yet support lazy-loaded components." );
|
|
3993
3706
|
}
|
|
3994
|
-
}
|
|
3707
|
+
}
|
|
3995
3708
|
|
|
3996
3709
|
}
|
|
3997
3710
|
}
|
|
@@ -3999,33 +3712,12 @@ function () {
|
|
|
3999
3712
|
|
|
4000
3713
|
case REACT_SCOPE_TYPE:
|
|
4001
3714
|
{
|
|
4002
|
-
if (enableScopeAPI) {
|
|
4003
|
-
var _nextChildren10 = toArray(nextChild.props.children);
|
|
4004
|
-
|
|
4005
|
-
var _frame10 = {
|
|
4006
|
-
type: null,
|
|
4007
|
-
domNamespace: parentNamespace,
|
|
4008
|
-
children: _nextChildren10,
|
|
4009
|
-
childIndex: 0,
|
|
4010
|
-
context: context,
|
|
4011
|
-
footer: ''
|
|
4012
|
-
};
|
|
4013
3715
|
|
|
3716
|
+
{
|
|
4014
3717
|
{
|
|
4015
|
-
|
|
3718
|
+
throw Error( "ReactDOMServer does not yet support scope components." );
|
|
4016
3719
|
}
|
|
4017
|
-
|
|
4018
|
-
this.stack.push(_frame10);
|
|
4019
|
-
return '';
|
|
4020
3720
|
}
|
|
4021
|
-
|
|
4022
|
-
(function () {
|
|
4023
|
-
{
|
|
4024
|
-
{
|
|
4025
|
-
throw ReactError(Error("ReactDOMServer does not yet support scope components."));
|
|
4026
|
-
}
|
|
4027
|
-
}
|
|
4028
|
-
})();
|
|
4029
3721
|
}
|
|
4030
3722
|
}
|
|
4031
3723
|
}
|
|
@@ -4046,13 +3738,11 @@ function () {
|
|
|
4046
3738
|
}
|
|
4047
3739
|
}
|
|
4048
3740
|
|
|
4049
|
-
|
|
3741
|
+
{
|
|
4050
3742
|
{
|
|
4051
|
-
|
|
4052
|
-
throw ReactError(Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (elementType == null ? elementType : typeof elementType) + "." + info));
|
|
4053
|
-
}
|
|
3743
|
+
throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (elementType == null ? elementType : typeof elementType) + "." + info );
|
|
4054
3744
|
}
|
|
4055
|
-
}
|
|
3745
|
+
}
|
|
4056
3746
|
}
|
|
4057
3747
|
};
|
|
4058
3748
|
|
|
@@ -4068,7 +3758,9 @@ function () {
|
|
|
4068
3758
|
if (namespace === Namespaces.html) {
|
|
4069
3759
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
4070
3760
|
// allow <SVG> or <mATH>.
|
|
4071
|
-
|
|
3761
|
+
if (tag !== element.type) {
|
|
3762
|
+
error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type);
|
|
3763
|
+
}
|
|
4072
3764
|
}
|
|
4073
3765
|
}
|
|
4074
3766
|
|
|
@@ -4080,12 +3772,14 @@ function () {
|
|
|
4080
3772
|
ReactControlledValuePropTypes.checkPropTypes('input', props);
|
|
4081
3773
|
|
|
4082
3774
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
|
4083
|
-
|
|
3775
|
+
error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
|
3776
|
+
|
|
4084
3777
|
didWarnDefaultChecked = true;
|
|
4085
3778
|
}
|
|
4086
3779
|
|
|
4087
3780
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
|
4088
|
-
|
|
3781
|
+
error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
|
3782
|
+
|
|
4089
3783
|
didWarnDefaultInputValue = true;
|
|
4090
3784
|
}
|
|
4091
3785
|
}
|
|
@@ -4103,7 +3797,8 @@ function () {
|
|
|
4103
3797
|
ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
|
4104
3798
|
|
|
4105
3799
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
|
4106
|
-
|
|
3800
|
+
error('Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
|
3801
|
+
|
|
4107
3802
|
didWarnDefaultTextareaValue = true;
|
|
4108
3803
|
}
|
|
4109
3804
|
}
|
|
@@ -4117,25 +3812,21 @@ function () {
|
|
|
4117
3812
|
|
|
4118
3813
|
if (textareaChildren != null) {
|
|
4119
3814
|
{
|
|
4120
|
-
|
|
3815
|
+
error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
4121
3816
|
}
|
|
4122
3817
|
|
|
4123
|
-
(
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
throw ReactError(Error("If you supply `defaultValue` on a <textarea>, do not pass children."));
|
|
4127
|
-
}
|
|
3818
|
+
if (!(defaultValue == null)) {
|
|
3819
|
+
{
|
|
3820
|
+
throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
|
|
4128
3821
|
}
|
|
4129
|
-
}
|
|
3822
|
+
}
|
|
4130
3823
|
|
|
4131
3824
|
if (Array.isArray(textareaChildren)) {
|
|
4132
|
-
(
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
throw ReactError(Error("<textarea> can only have at most one child."));
|
|
4136
|
-
}
|
|
3825
|
+
if (!(textareaChildren.length <= 1)) {
|
|
3826
|
+
{
|
|
3827
|
+
throw Error( "<textarea> can only have at most one child." );
|
|
4137
3828
|
}
|
|
4138
|
-
}
|
|
3829
|
+
}
|
|
4139
3830
|
|
|
4140
3831
|
textareaChildren = textareaChildren[0];
|
|
4141
3832
|
}
|
|
@@ -4168,14 +3859,15 @@ function () {
|
|
|
4168
3859
|
var isArray = Array.isArray(props[propName]);
|
|
4169
3860
|
|
|
4170
3861
|
if (props.multiple && !isArray) {
|
|
4171
|
-
|
|
3862
|
+
error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
|
4172
3863
|
} else if (!props.multiple && isArray) {
|
|
4173
|
-
|
|
3864
|
+
error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
|
4174
3865
|
}
|
|
4175
3866
|
}
|
|
4176
3867
|
|
|
4177
3868
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
|
4178
|
-
|
|
3869
|
+
error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
|
3870
|
+
|
|
4179
3871
|
didWarnDefaultSelectValue = true;
|
|
4180
3872
|
}
|
|
4181
3873
|
}
|
|
@@ -4243,7 +3935,7 @@ function () {
|
|
|
4243
3935
|
if (innerMarkup != null) {
|
|
4244
3936
|
children = [];
|
|
4245
3937
|
|
|
4246
|
-
if (newlineEatingTags
|
|
3938
|
+
if (newlineEatingTags.hasOwnProperty(tag) && innerMarkup.charAt(0) === '\n') {
|
|
4247
3939
|
// text/html ignores the first character in these tags if it's a newline
|
|
4248
3940
|
// Prefer to break application/xml over text/html (for now) by adding
|
|
4249
3941
|
// a newline specifically to get eaten by the parser. (Alternately for
|
|
@@ -4374,7 +4066,7 @@ function renderToStaticNodeStream(element) {
|
|
|
4374
4066
|
return new ReactMarkupReadableStream(element, true);
|
|
4375
4067
|
}
|
|
4376
4068
|
|
|
4377
|
-
var
|
|
4069
|
+
var ReactDOMServer = {
|
|
4378
4070
|
renderToString: renderToString,
|
|
4379
4071
|
renderToStaticMarkup: renderToStaticMarkup,
|
|
4380
4072
|
renderToNodeStream: renderToNodeStream,
|
|
@@ -4382,12 +4074,6 @@ var ReactDOMServerNode = {
|
|
|
4382
4074
|
version: ReactVersion
|
|
4383
4075
|
};
|
|
4384
4076
|
|
|
4385
|
-
var ReactDOMServerNode$1 = Object.freeze({
|
|
4386
|
-
default: ReactDOMServerNode
|
|
4387
|
-
});
|
|
4388
|
-
|
|
4389
|
-
var ReactDOMServer = ( ReactDOMServerNode$1 && ReactDOMServerNode ) || ReactDOMServerNode$1;
|
|
4390
|
-
|
|
4391
4077
|
// TODO: decide on the top-level export form.
|
|
4392
4078
|
// This is hacky but makes it work with both Rollup and Jest
|
|
4393
4079
|
|