react-dom 16.11.0 → 16.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/react-dom-server.browser.development.js +331 -596
- package/cjs/react-dom-server.browser.production.min.js +37 -37
- package/cjs/react-dom-server.node.development.js +330 -595
- package/cjs/react-dom-server.node.production.min.js +38 -38
- package/cjs/react-dom-test-utils.development.js +171 -326
- package/cjs/react-dom-test-utils.production.min.js +17 -17
- 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 +190 -305
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +23 -27
- package/cjs/react-dom.development.js +9554 -12269
- package/cjs/react-dom.production.min.js +280 -278
- package/cjs/react-dom.profiling.min.js +285 -282
- package/package.json +30 -25
- package/umd/react-dom-server.browser.development.js +3320 -3596
- package/umd/react-dom-server.browser.production.min.js +35 -35
- package/umd/react-dom-test-utils.development.js +1200 -1355
- 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 +1333 -1449
- package/umd/react-dom-unstable-native-dependencies.production.min.js +21 -22
- package/umd/react-dom.development.js +19871 -22597
- package/umd/react-dom.production.min.js +229 -231
- package/umd/react-dom.profiling.min.js +237 -239
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.14.0
|
|
2
2
|
* react-dom-server.browser.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,66 +15,91 @@ 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
|
|
|
22
22
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
23
23
|
// template literal strings. The messages will be replaced with error codes
|
|
24
24
|
// during build.
|
|
25
|
+
function formatProdErrorMessage(code) {
|
|
26
|
+
var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
29
|
+
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
30
|
+
}
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
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.';
|
|
33
|
+
}
|
|
29
34
|
|
|
30
|
-
|
|
31
|
-
* Use invariant() to assert state which your program assumes to be true.
|
|
32
|
-
*
|
|
33
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
34
|
-
* to provide information about what broke and what you were
|
|
35
|
-
* expecting.
|
|
36
|
-
*
|
|
37
|
-
* The invariant message will be stripped in production, but the invariant
|
|
38
|
-
* will remain to ensure logic does not differ in production.
|
|
39
|
-
*/
|
|
35
|
+
var ReactVersion = '16.14.0';
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* paths. Removing the logging code for production environments will keep the
|
|
45
|
-
* same logic and follow the same code paths.
|
|
46
|
-
*/
|
|
47
|
-
var warningWithoutStack = function () {};
|
|
37
|
+
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.
|
|
38
|
+
// Current owner and dispatcher used to share the same ref,
|
|
39
|
+
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
48
40
|
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
42
|
+
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
43
|
+
current: null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
48
|
+
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
49
|
+
suspense: null
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// by calls to these methods by a Babel plugin.
|
|
54
|
+
//
|
|
55
|
+
// In PROD (or in packages without access to React internals),
|
|
56
|
+
// they are left as they are instead.
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
function warn(format) {
|
|
59
|
+
{
|
|
60
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
61
|
+
args[_key - 1] = arguments[_key];
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
printWarning('warn', format, args);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function error(format) {
|
|
68
|
+
{
|
|
69
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
70
|
+
args[_key2 - 1] = arguments[_key2];
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
printWarning('error', format, args);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function printWarning(level, format, args) {
|
|
78
|
+
// When changing this logic, you might want to also
|
|
79
|
+
// update consoleWithStackDev.www.js as well.
|
|
80
|
+
{
|
|
81
|
+
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
|
|
82
|
+
|
|
83
|
+
if (!hasExistingStack) {
|
|
84
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
85
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
74
86
|
|
|
75
|
-
|
|
87
|
+
if (stack !== '') {
|
|
88
|
+
format += '%s';
|
|
89
|
+
args = args.concat([stack]);
|
|
90
|
+
}
|
|
76
91
|
}
|
|
77
92
|
|
|
93
|
+
var argsWithFormat = args.map(function (item) {
|
|
94
|
+
return '' + item;
|
|
95
|
+
}); // Careful: RN currently depends on this prefix
|
|
96
|
+
|
|
97
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
98
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
99
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
100
|
+
|
|
101
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
102
|
+
|
|
78
103
|
try {
|
|
79
104
|
// --- Welcome to debugging React ---
|
|
80
105
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -85,78 +110,28 @@ var warningWithoutStack = function () {};
|
|
|
85
110
|
});
|
|
86
111
|
throw new Error(message);
|
|
87
112
|
} catch (x) {}
|
|
88
|
-
}
|
|
113
|
+
}
|
|
89
114
|
}
|
|
90
115
|
|
|
91
|
-
var warningWithoutStack$1 = warningWithoutStack;
|
|
92
|
-
|
|
93
116
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
94
117
|
// nor polyfill, then a plain number is used for performance.
|
|
95
118
|
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
96
|
-
|
|
97
119
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
98
120
|
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
99
121
|
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
100
122
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
101
123
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
102
124
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
103
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
104
|
-
|
|
105
|
-
|
|
106
125
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
107
126
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
108
127
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
109
128
|
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
110
129
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
111
130
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
131
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
112
132
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
113
|
-
|
|
114
133
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
115
134
|
|
|
116
|
-
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.
|
|
117
|
-
// Current owner and dispatcher used to share the same ref,
|
|
118
|
-
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
119
|
-
|
|
120
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
121
|
-
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
122
|
-
current: null
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
127
|
-
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
128
|
-
suspense: null
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
134
|
-
* This can be used to log issues in development environments in critical
|
|
135
|
-
* paths. Removing the logging code for production environments will keep the
|
|
136
|
-
* same logic and follow the same code paths.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
var warning = warningWithoutStack$1;
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
warning = function (condition, format) {
|
|
143
|
-
if (condition) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
148
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
149
|
-
|
|
150
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
151
|
-
args[_key - 2] = arguments[_key];
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
var warning$1 = warning;
|
|
159
|
-
|
|
160
135
|
var Uninitialized = -1;
|
|
161
136
|
var Pending = 0;
|
|
162
137
|
var Resolved = 1;
|
|
@@ -176,7 +151,7 @@ function initializeLazyComponentType(lazyComponent) {
|
|
|
176
151
|
|
|
177
152
|
{
|
|
178
153
|
if (defaultExport === undefined) {
|
|
179
|
-
|
|
154
|
+
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);
|
|
180
155
|
}
|
|
181
156
|
}
|
|
182
157
|
|
|
@@ -205,7 +180,7 @@ function getComponentName(type) {
|
|
|
205
180
|
|
|
206
181
|
{
|
|
207
182
|
if (typeof type.tag === 'number') {
|
|
208
|
-
|
|
183
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
209
184
|
}
|
|
210
185
|
}
|
|
211
186
|
|
|
@@ -251,6 +226,9 @@ function getComponentName(type) {
|
|
|
251
226
|
case REACT_MEMO_TYPE:
|
|
252
227
|
return getComponentName(type.type);
|
|
253
228
|
|
|
229
|
+
case REACT_BLOCK_TYPE:
|
|
230
|
+
return getComponentName(type.render);
|
|
231
|
+
|
|
254
232
|
case REACT_LAZY_TYPE:
|
|
255
233
|
{
|
|
256
234
|
var thenable = type;
|
|
@@ -268,63 +246,8 @@ function getComponentName(type) {
|
|
|
268
246
|
return null;
|
|
269
247
|
}
|
|
270
248
|
|
|
271
|
-
/**
|
|
272
|
-
* Forked from fbjs/warning:
|
|
273
|
-
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
|
274
|
-
*
|
|
275
|
-
* Only change is we use console.warn instead of console.error,
|
|
276
|
-
* and do nothing when 'console' is not supported.
|
|
277
|
-
* This really simplifies the code.
|
|
278
|
-
* ---
|
|
279
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
280
|
-
* This can be used to log issues in development environments in critical
|
|
281
|
-
* paths. Removing the logging code for production environments will keep the
|
|
282
|
-
* same logic and follow the same code paths.
|
|
283
|
-
*/
|
|
284
|
-
var lowPriorityWarningWithoutStack = function () {};
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
var printWarning = function (format) {
|
|
288
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
289
|
-
args[_key - 1] = arguments[_key];
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
var argIndex = 0;
|
|
293
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
294
|
-
return args[argIndex++];
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
if (typeof console !== 'undefined') {
|
|
298
|
-
console.warn(message);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
try {
|
|
302
|
-
// --- Welcome to debugging React ---
|
|
303
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
304
|
-
// to find the callsite that caused this warning to fire.
|
|
305
|
-
throw new Error(message);
|
|
306
|
-
} catch (x) {}
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
lowPriorityWarningWithoutStack = function (condition, format) {
|
|
310
|
-
if (format === undefined) {
|
|
311
|
-
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (!condition) {
|
|
315
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
316
|
-
args[_key2 - 2] = arguments[_key2];
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
printWarning.apply(void 0, [format].concat(args));
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
|
325
|
-
|
|
326
249
|
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
327
|
-
|
|
250
|
+
function describeComponentFrame (name, source, ownerName) {
|
|
328
251
|
var sourceInfo = '';
|
|
329
252
|
|
|
330
253
|
if (source) {
|
|
@@ -354,73 +277,17 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
354
277
|
}
|
|
355
278
|
|
|
356
279
|
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
360
|
-
|
|
361
|
-
// In some cases, StrictMode should also double-render lifecycles.
|
|
362
|
-
// This can be confusing for tests though,
|
|
363
|
-
// And it can be bad for performance in production.
|
|
364
|
-
// This feature flag can be used to control the behavior:
|
|
365
|
-
|
|
366
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
367
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
368
|
-
|
|
369
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
370
|
-
|
|
371
|
-
var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
|
|
372
|
-
|
|
373
|
-
// Trace which interactions trigger each commit.
|
|
374
|
-
|
|
375
|
-
// SSR experiments
|
|
280
|
+
}
|
|
376
281
|
|
|
377
282
|
var enableSuspenseServerRenderer = false;
|
|
378
|
-
// Only used in www builds.
|
|
379
|
-
|
|
380
|
-
// Only used in www builds.
|
|
381
|
-
|
|
382
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
383
|
-
|
|
384
|
-
var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
|
|
385
|
-
// with their related DOM properties
|
|
386
|
-
|
|
387
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
388
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
// Experimental React Flare event system and event components support.
|
|
392
283
|
|
|
393
|
-
var
|
|
284
|
+
var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
|
|
394
285
|
|
|
395
|
-
var
|
|
396
|
-
|
|
397
|
-
var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
|
|
398
|
-
|
|
399
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
400
|
-
// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
|
|
401
|
-
|
|
402
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
403
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
404
|
-
|
|
405
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
406
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
407
|
-
// the user to see a loading state.
|
|
408
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
409
|
-
// hydrated or deleted.
|
|
410
|
-
|
|
411
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
412
|
-
// from React.createElement to React.jsx
|
|
413
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
var disableLegacyContext = false;
|
|
418
|
-
|
|
419
|
-
var ReactDebugCurrentFrame$1;
|
|
286
|
+
var ReactDebugCurrentFrame;
|
|
420
287
|
var didWarnAboutInvalidateContextType;
|
|
421
288
|
|
|
422
289
|
{
|
|
423
|
-
ReactDebugCurrentFrame
|
|
290
|
+
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
424
291
|
didWarnAboutInvalidateContextType = new Set();
|
|
425
292
|
}
|
|
426
293
|
|
|
@@ -448,7 +315,7 @@ function maskContext(type, context) {
|
|
|
448
315
|
|
|
449
316
|
function checkContextTypes(typeSpecs, values, location) {
|
|
450
317
|
{
|
|
451
|
-
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame
|
|
318
|
+
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack);
|
|
452
319
|
}
|
|
453
320
|
}
|
|
454
321
|
|
|
@@ -491,7 +358,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
491
358
|
addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
|
|
492
359
|
}
|
|
493
360
|
|
|
494
|
-
|
|
361
|
+
error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
|
|
495
362
|
}
|
|
496
363
|
}
|
|
497
364
|
}
|
|
@@ -501,15 +368,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
501
368
|
return contextType[threadID];
|
|
502
369
|
}
|
|
503
370
|
|
|
504
|
-
|
|
505
|
-
{
|
|
506
|
-
if (type.contextTypes) {
|
|
507
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
return emptyObject;
|
|
512
|
-
} else {
|
|
371
|
+
{
|
|
513
372
|
var maskedContext = maskContext(type, context);
|
|
514
373
|
|
|
515
374
|
{
|
|
@@ -521,15 +380,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
521
380
|
return maskedContext;
|
|
522
381
|
}
|
|
523
382
|
} else {
|
|
524
|
-
|
|
525
|
-
{
|
|
526
|
-
if (type.contextTypes) {
|
|
527
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
return undefined;
|
|
532
|
-
} else {
|
|
383
|
+
{
|
|
533
384
|
var _maskedContext = maskContext(type, context);
|
|
534
385
|
|
|
535
386
|
{
|
|
@@ -543,9 +394,6 @@ function processContext(type, context, threadID, isClass) {
|
|
|
543
394
|
}
|
|
544
395
|
}
|
|
545
396
|
|
|
546
|
-
// Allocates a new index for each request. Tries to stay as compact as possible so that these
|
|
547
|
-
// indices can be used to reference a tightly packed array. As opposed to being used in a Map.
|
|
548
|
-
// The first allocated index is 1.
|
|
549
397
|
var nextAvailableThreadIDs = new Uint16Array(16);
|
|
550
398
|
|
|
551
399
|
for (var i = 0; i < 15; i++) {
|
|
@@ -561,7 +409,7 @@ function growThreadCountAndReturnNextAvailable() {
|
|
|
561
409
|
|
|
562
410
|
if (!(newSize <= 0x10000)) {
|
|
563
411
|
{
|
|
564
|
-
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.");
|
|
412
|
+
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." );
|
|
565
413
|
}
|
|
566
414
|
}
|
|
567
415
|
|
|
@@ -625,18 +473,17 @@ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\
|
|
|
625
473
|
/* eslint-enable max-len */
|
|
626
474
|
|
|
627
475
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
628
|
-
|
|
629
476
|
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
|
630
477
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
631
|
-
var hasOwnProperty
|
|
478
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
632
479
|
var illegalAttributeNameCache = {};
|
|
633
480
|
var validatedAttributeNameCache = {};
|
|
634
481
|
function isAttributeNameSafe(attributeName) {
|
|
635
|
-
if (hasOwnProperty
|
|
482
|
+
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
|
636
483
|
return true;
|
|
637
484
|
}
|
|
638
485
|
|
|
639
|
-
if (hasOwnProperty
|
|
486
|
+
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
|
640
487
|
return false;
|
|
641
488
|
}
|
|
642
489
|
|
|
@@ -648,7 +495,7 @@ function isAttributeNameSafe(attributeName) {
|
|
|
648
495
|
illegalAttributeNameCache[attributeName] = true;
|
|
649
496
|
|
|
650
497
|
{
|
|
651
|
-
|
|
498
|
+
error('Invalid attribute name: `%s`', attributeName);
|
|
652
499
|
}
|
|
653
500
|
|
|
654
501
|
return false;
|
|
@@ -748,10 +595,12 @@ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attribut
|
|
|
748
595
|
|
|
749
596
|
var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
|
|
750
597
|
|
|
751
|
-
['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
|
|
598
|
+
var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
|
|
752
599
|
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
753
600
|
// defaultValue property -- do we need this?
|
|
754
|
-
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']
|
|
601
|
+
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
|
|
602
|
+
|
|
603
|
+
reservedProps.forEach(function (name) {
|
|
755
604
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
756
605
|
name, // attributeName
|
|
757
606
|
null, // attributeNamespace
|
|
@@ -800,7 +649,10 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
800
649
|
|
|
801
650
|
['checked', // Note: `option.selected` is not updated if `select.multiple` is
|
|
802
651
|
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
803
|
-
'multiple', 'muted', 'selected'
|
|
652
|
+
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
|
|
653
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
654
|
+
// instead in the assignment below.
|
|
655
|
+
].forEach(function (name) {
|
|
804
656
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
805
657
|
name, // attributeName
|
|
806
658
|
null, // attributeNamespace
|
|
@@ -808,14 +660,20 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
808
660
|
}); // These are HTML attributes that are "overloaded booleans": they behave like
|
|
809
661
|
// booleans, but can also accept a string value.
|
|
810
662
|
|
|
811
|
-
['capture', 'download'
|
|
663
|
+
['capture', 'download' // NOTE: if you add a camelCased prop to this list,
|
|
664
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
665
|
+
// instead in the assignment below.
|
|
666
|
+
].forEach(function (name) {
|
|
812
667
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
813
668
|
name, // attributeName
|
|
814
669
|
null, // attributeNamespace
|
|
815
670
|
false);
|
|
816
671
|
}); // These are HTML attributes that must be positive numbers.
|
|
817
672
|
|
|
818
|
-
['cols', 'rows', 'size', 'span'
|
|
673
|
+
['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
|
|
674
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
675
|
+
// instead in the assignment below.
|
|
676
|
+
].forEach(function (name) {
|
|
819
677
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
820
678
|
name, // attributeName
|
|
821
679
|
null, // attributeNamespace
|
|
@@ -836,23 +694,32 @@ var capitalize = function (token) {
|
|
|
836
694
|
// or boolean value assignment. Regular attributes that just accept strings
|
|
837
695
|
// and have the same names are omitted, just like in the HTML whitelist.
|
|
838
696
|
// Some of these attributes can be hard to find. This list was created by
|
|
839
|
-
//
|
|
697
|
+
// scraping the MDN documentation.
|
|
840
698
|
|
|
841
699
|
|
|
842
|
-
['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'
|
|
700
|
+
['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,
|
|
701
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
702
|
+
// instead in the assignment below.
|
|
703
|
+
].forEach(function (attributeName) {
|
|
843
704
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
844
705
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
845
706
|
attributeName, null, // attributeNamespace
|
|
846
707
|
false);
|
|
847
708
|
}); // String SVG attributes with the xlink namespace.
|
|
848
709
|
|
|
849
|
-
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'
|
|
710
|
+
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
|
|
711
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
712
|
+
// instead in the assignment below.
|
|
713
|
+
].forEach(function (attributeName) {
|
|
850
714
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
851
715
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
852
716
|
attributeName, 'http://www.w3.org/1999/xlink', false);
|
|
853
717
|
}); // String SVG attributes with the xml namespace.
|
|
854
718
|
|
|
855
|
-
['xml:base', 'xml:lang', 'xml:space'
|
|
719
|
+
['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
|
|
720
|
+
// you'll need to set attributeName to name.toLowerCase()
|
|
721
|
+
// instead in the assignment below.
|
|
722
|
+
].forEach(function (attributeName) {
|
|
856
723
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
857
724
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
858
725
|
attributeName, 'http://www.w3.org/XML/1998/namespace', false);
|
|
@@ -878,10 +745,10 @@ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mu
|
|
|
878
745
|
true);
|
|
879
746
|
});
|
|
880
747
|
|
|
881
|
-
var ReactDebugCurrentFrame$
|
|
748
|
+
var ReactDebugCurrentFrame$1 = null;
|
|
882
749
|
|
|
883
750
|
{
|
|
884
|
-
ReactDebugCurrentFrame$
|
|
751
|
+
ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
885
752
|
} // A javascript: URL can contain leading C0 control or \u0020 SPACE,
|
|
886
753
|
// and any newline or tab are filtered out as if they're not part of the URL.
|
|
887
754
|
// https://url.spec.whatwg.org/#url-parsing
|
|
@@ -898,15 +765,12 @@ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r
|
|
|
898
765
|
var didWarn = false;
|
|
899
766
|
|
|
900
767
|
function sanitizeURL(url) {
|
|
901
|
-
|
|
902
|
-
if (
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
768
|
+
{
|
|
769
|
+
if (!didWarn && isJavaScriptProtocol.test(url)) {
|
|
770
|
+
didWarn = true;
|
|
771
|
+
|
|
772
|
+
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));
|
|
906
773
|
}
|
|
907
|
-
} else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
|
|
908
|
-
didWarn = true;
|
|
909
|
-
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));
|
|
910
774
|
}
|
|
911
775
|
}
|
|
912
776
|
|
|
@@ -1011,18 +875,6 @@ function quoteAttributeValueForBrowser(value) {
|
|
|
1011
875
|
return '"' + escapeTextForBrowser(value) + '"';
|
|
1012
876
|
}
|
|
1013
877
|
|
|
1014
|
-
/**
|
|
1015
|
-
* Operations for dealing with DOM properties.
|
|
1016
|
-
*/
|
|
1017
|
-
|
|
1018
|
-
/**
|
|
1019
|
-
* Creates markup for the ID property.
|
|
1020
|
-
*
|
|
1021
|
-
* @param {string} id Unescaped ID.
|
|
1022
|
-
* @return {string} Markup string.
|
|
1023
|
-
*/
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
878
|
function createMarkupForRoot() {
|
|
1027
879
|
return ROOT_ATTRIBUTE_NAME + '=""';
|
|
1028
880
|
}
|
|
@@ -1090,7 +942,7 @@ function is(x, y) {
|
|
|
1090
942
|
;
|
|
1091
943
|
}
|
|
1092
944
|
|
|
1093
|
-
var
|
|
945
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
1094
946
|
|
|
1095
947
|
var currentlyRenderingComponent = null;
|
|
1096
948
|
var firstWorkInProgressHook = null;
|
|
@@ -1111,12 +963,14 @@ var currentHookNameInDev;
|
|
|
1111
963
|
function resolveCurrentlyRenderingComponent() {
|
|
1112
964
|
if (!(currentlyRenderingComponent !== null)) {
|
|
1113
965
|
{
|
|
1114
|
-
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.");
|
|
966
|
+
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." );
|
|
1115
967
|
}
|
|
1116
968
|
}
|
|
1117
969
|
|
|
1118
970
|
{
|
|
1119
|
-
|
|
971
|
+
if (isInHookUserCodeInDev) {
|
|
972
|
+
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');
|
|
973
|
+
}
|
|
1120
974
|
}
|
|
1121
975
|
|
|
1122
976
|
return currentlyRenderingComponent;
|
|
@@ -1125,7 +979,7 @@ function resolveCurrentlyRenderingComponent() {
|
|
|
1125
979
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
1126
980
|
if (prevDeps === null) {
|
|
1127
981
|
{
|
|
1128
|
-
|
|
982
|
+
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);
|
|
1129
983
|
}
|
|
1130
984
|
|
|
1131
985
|
return false;
|
|
@@ -1135,12 +989,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
1135
989
|
// Don't bother comparing lengths in prod because these arrays should be
|
|
1136
990
|
// passed inline.
|
|
1137
991
|
if (nextDeps.length !== prevDeps.length) {
|
|
1138
|
-
|
|
992
|
+
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(', ') + "]");
|
|
1139
993
|
}
|
|
1140
994
|
}
|
|
1141
995
|
|
|
1142
996
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
|
1143
|
-
if (
|
|
997
|
+
if (objectIs(nextDeps[i], prevDeps[i])) {
|
|
1144
998
|
continue;
|
|
1145
999
|
}
|
|
1146
1000
|
|
|
@@ -1154,7 +1008,7 @@ function createHook() {
|
|
|
1154
1008
|
if (numberOfReRenders > 0) {
|
|
1155
1009
|
{
|
|
1156
1010
|
{
|
|
1157
|
-
throw Error("Rendered more hooks than during the previous render");
|
|
1011
|
+
throw Error( "Rendered more hooks than during the previous render" );
|
|
1158
1012
|
}
|
|
1159
1013
|
}
|
|
1160
1014
|
}
|
|
@@ -1245,7 +1099,9 @@ function readContext(context, observedBits) {
|
|
|
1245
1099
|
validateContextBounds(context, threadID);
|
|
1246
1100
|
|
|
1247
1101
|
{
|
|
1248
|
-
|
|
1102
|
+
if (isInHookUserCodeInDev) {
|
|
1103
|
+
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().');
|
|
1104
|
+
}
|
|
1249
1105
|
}
|
|
1250
1106
|
|
|
1251
1107
|
return context[threadID];
|
|
@@ -1263,6 +1119,7 @@ function useContext(context, observedBits) {
|
|
|
1263
1119
|
}
|
|
1264
1120
|
|
|
1265
1121
|
function basicStateReducer(state, action) {
|
|
1122
|
+
// $FlowFixMe: Flow doesn't like mixed types
|
|
1266
1123
|
return typeof action === 'function' ? action(state) : action;
|
|
1267
1124
|
}
|
|
1268
1125
|
|
|
@@ -1412,15 +1269,15 @@ function useRef(initialValue) {
|
|
|
1412
1269
|
function useLayoutEffect(create, inputs) {
|
|
1413
1270
|
{
|
|
1414
1271
|
currentHookNameInDev = 'useLayoutEffect';
|
|
1415
|
-
}
|
|
1416
1272
|
|
|
1417
|
-
|
|
1273
|
+
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.');
|
|
1274
|
+
}
|
|
1418
1275
|
}
|
|
1419
1276
|
|
|
1420
1277
|
function dispatchAction(componentIdentity, queue, action) {
|
|
1421
1278
|
if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
1422
1279
|
{
|
|
1423
|
-
throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
|
|
1280
|
+
throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
|
|
1424
1281
|
}
|
|
1425
1282
|
}
|
|
1426
1283
|
|
|
@@ -1452,9 +1309,6 @@ function dispatchAction(componentIdentity, queue, action) {
|
|
|
1452
1309
|
|
|
1453
1310
|
lastRenderPhaseUpdate.next = update;
|
|
1454
1311
|
}
|
|
1455
|
-
} else {// This means an update has happened after the function component has
|
|
1456
|
-
// returned. On the server this is a no-op. In React Fiber, the update
|
|
1457
|
-
// would be scheduled for a future render.
|
|
1458
1312
|
}
|
|
1459
1313
|
}
|
|
1460
1314
|
|
|
@@ -1547,13 +1401,13 @@ function getChildNamespace(parentNamespace, type) {
|
|
|
1547
1401
|
return parentNamespace;
|
|
1548
1402
|
}
|
|
1549
1403
|
|
|
1550
|
-
var ReactDebugCurrentFrame$
|
|
1404
|
+
var ReactDebugCurrentFrame$2 = null;
|
|
1551
1405
|
var ReactControlledValuePropTypes = {
|
|
1552
1406
|
checkPropTypes: null
|
|
1553
1407
|
};
|
|
1554
1408
|
|
|
1555
1409
|
{
|
|
1556
|
-
ReactDebugCurrentFrame$
|
|
1410
|
+
ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1557
1411
|
var hasReadOnlyValue = {
|
|
1558
1412
|
button: true,
|
|
1559
1413
|
checkbox: true,
|
|
@@ -1565,14 +1419,14 @@ var ReactControlledValuePropTypes = {
|
|
|
1565
1419
|
};
|
|
1566
1420
|
var propTypes = {
|
|
1567
1421
|
value: function (props, propName, componentName) {
|
|
1568
|
-
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null ||
|
|
1422
|
+
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
|
|
1569
1423
|
return null;
|
|
1570
1424
|
}
|
|
1571
1425
|
|
|
1572
1426
|
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`.');
|
|
1573
1427
|
},
|
|
1574
1428
|
checked: function (props, propName, componentName) {
|
|
1575
|
-
if (props.onChange || props.readOnly || props.disabled || props[propName] == null ||
|
|
1429
|
+
if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
|
|
1576
1430
|
return null;
|
|
1577
1431
|
}
|
|
1578
1432
|
|
|
@@ -1585,7 +1439,7 @@ var ReactControlledValuePropTypes = {
|
|
|
1585
1439
|
*/
|
|
1586
1440
|
|
|
1587
1441
|
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
|
1588
|
-
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$
|
|
1442
|
+
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
|
|
1589
1443
|
};
|
|
1590
1444
|
}
|
|
1591
1445
|
|
|
@@ -1616,13 +1470,11 @@ var voidElementTags = _assign({
|
|
|
1616
1470
|
menuitem: true
|
|
1617
1471
|
}, omittedCloseTags);
|
|
1618
1472
|
|
|
1619
|
-
// or add stack by default to invariants where possible.
|
|
1620
|
-
|
|
1621
1473
|
var HTML = '__html';
|
|
1622
|
-
var ReactDebugCurrentFrame$
|
|
1474
|
+
var ReactDebugCurrentFrame$3 = null;
|
|
1623
1475
|
|
|
1624
1476
|
{
|
|
1625
|
-
ReactDebugCurrentFrame$
|
|
1477
|
+
ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1626
1478
|
}
|
|
1627
1479
|
|
|
1628
1480
|
function assertValidProps(tag, props) {
|
|
@@ -1634,7 +1486,7 @@ function assertValidProps(tag, props) {
|
|
|
1634
1486
|
if (voidElementTags[tag]) {
|
|
1635
1487
|
if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
|
|
1636
1488
|
{
|
|
1637
|
-
throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$
|
|
1489
|
+
throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
|
|
1638
1490
|
}
|
|
1639
1491
|
}
|
|
1640
1492
|
}
|
|
@@ -1642,24 +1494,26 @@ function assertValidProps(tag, props) {
|
|
|
1642
1494
|
if (props.dangerouslySetInnerHTML != null) {
|
|
1643
1495
|
if (!(props.children == null)) {
|
|
1644
1496
|
{
|
|
1645
|
-
throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
|
|
1497
|
+
throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
|
|
1646
1498
|
}
|
|
1647
1499
|
}
|
|
1648
1500
|
|
|
1649
1501
|
if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
|
|
1650
1502
|
{
|
|
1651
|
-
throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
|
|
1503
|
+
throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." );
|
|
1652
1504
|
}
|
|
1653
1505
|
}
|
|
1654
1506
|
}
|
|
1655
1507
|
|
|
1656
1508
|
{
|
|
1657
|
-
!
|
|
1509
|
+
if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
|
|
1510
|
+
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.');
|
|
1511
|
+
}
|
|
1658
1512
|
}
|
|
1659
1513
|
|
|
1660
1514
|
if (!(props.style == null || typeof props.style === 'object')) {
|
|
1661
1515
|
{
|
|
1662
|
-
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$
|
|
1516
|
+
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() ) );
|
|
1663
1517
|
}
|
|
1664
1518
|
}
|
|
1665
1519
|
}
|
|
@@ -1841,7 +1695,8 @@ var warnValidStyle = function () {};
|
|
|
1841
1695
|
}
|
|
1842
1696
|
|
|
1843
1697
|
warnedStyleNames[name] = true;
|
|
1844
|
-
|
|
1698
|
+
|
|
1699
|
+
error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
|
|
1845
1700
|
// (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
1846
1701
|
// is converted to lowercase `ms`.
|
|
1847
1702
|
camelize(name.replace(msPattern$1, 'ms-')));
|
|
@@ -1853,7 +1708,8 @@ var warnValidStyle = function () {};
|
|
|
1853
1708
|
}
|
|
1854
1709
|
|
|
1855
1710
|
warnedStyleNames[name] = true;
|
|
1856
|
-
|
|
1711
|
+
|
|
1712
|
+
error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
1857
1713
|
};
|
|
1858
1714
|
|
|
1859
1715
|
var warnStyleValueWithSemicolon = function (name, value) {
|
|
@@ -1862,7 +1718,8 @@ var warnValidStyle = function () {};
|
|
|
1862
1718
|
}
|
|
1863
1719
|
|
|
1864
1720
|
warnedStyleValues[value] = true;
|
|
1865
|
-
|
|
1721
|
+
|
|
1722
|
+
error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
|
1866
1723
|
};
|
|
1867
1724
|
|
|
1868
1725
|
var warnStyleValueIsNaN = function (name, value) {
|
|
@@ -1871,7 +1728,8 @@ var warnValidStyle = function () {};
|
|
|
1871
1728
|
}
|
|
1872
1729
|
|
|
1873
1730
|
warnedForNaNValue = true;
|
|
1874
|
-
|
|
1731
|
+
|
|
1732
|
+
error('`NaN` is an invalid value for the `%s` css style property.', name);
|
|
1875
1733
|
};
|
|
1876
1734
|
|
|
1877
1735
|
var warnStyleValueIsInfinity = function (name, value) {
|
|
@@ -1880,7 +1738,8 @@ var warnValidStyle = function () {};
|
|
|
1880
1738
|
}
|
|
1881
1739
|
|
|
1882
1740
|
warnedForInfinityValue = true;
|
|
1883
|
-
|
|
1741
|
+
|
|
1742
|
+
error('`Infinity` is an invalid value for the `%s` css style property.', name);
|
|
1884
1743
|
};
|
|
1885
1744
|
|
|
1886
1745
|
warnValidStyle = function (name, value) {
|
|
@@ -1966,47 +1825,52 @@ var ariaProperties = {
|
|
|
1966
1825
|
var warnedProperties = {};
|
|
1967
1826
|
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1968
1827
|
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1969
|
-
var hasOwnProperty$
|
|
1828
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1970
1829
|
|
|
1971
1830
|
function validateProperty(tagName, name) {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1831
|
+
{
|
|
1832
|
+
if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
|
|
1833
|
+
return true;
|
|
1834
|
+
}
|
|
1975
1835
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1836
|
+
if (rARIACamel.test(name)) {
|
|
1837
|
+
var ariaName = 'aria-' + name.slice(4).toLowerCase();
|
|
1838
|
+
var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
|
|
1839
|
+
// DOM properties, then it is an invalid aria-* attribute.
|
|
1980
1840
|
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
warnedProperties[name] = true;
|
|
1984
|
-
return true;
|
|
1985
|
-
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
1841
|
+
if (correctName == null) {
|
|
1842
|
+
error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
|
1986
1843
|
|
|
1844
|
+
warnedProperties[name] = true;
|
|
1845
|
+
return true;
|
|
1846
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
1987
1847
|
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1848
|
+
|
|
1849
|
+
if (name !== correctName) {
|
|
1850
|
+
error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
|
1851
|
+
|
|
1852
|
+
warnedProperties[name] = true;
|
|
1853
|
+
return true;
|
|
1854
|
+
}
|
|
1992
1855
|
}
|
|
1993
|
-
}
|
|
1994
1856
|
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1857
|
+
if (rARIA.test(name)) {
|
|
1858
|
+
var lowerCasedName = name.toLowerCase();
|
|
1859
|
+
var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
|
|
1860
|
+
// DOM properties, then it is an invalid aria-* attribute.
|
|
1999
1861
|
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1862
|
+
if (standardName == null) {
|
|
1863
|
+
warnedProperties[name] = true;
|
|
1864
|
+
return false;
|
|
1865
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
2004
1866
|
|
|
2005
1867
|
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1868
|
+
if (name !== standardName) {
|
|
1869
|
+
error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
|
1870
|
+
|
|
1871
|
+
warnedProperties[name] = true;
|
|
1872
|
+
return true;
|
|
1873
|
+
}
|
|
2010
1874
|
}
|
|
2011
1875
|
}
|
|
2012
1876
|
|
|
@@ -2014,24 +1878,26 @@ function validateProperty(tagName, name) {
|
|
|
2014
1878
|
}
|
|
2015
1879
|
|
|
2016
1880
|
function warnInvalidARIAProps(type, props) {
|
|
2017
|
-
|
|
1881
|
+
{
|
|
1882
|
+
var invalidProps = [];
|
|
2018
1883
|
|
|
2019
|
-
|
|
2020
|
-
|
|
1884
|
+
for (var key in props) {
|
|
1885
|
+
var isValid = validateProperty(type, key);
|
|
2021
1886
|
|
|
2022
|
-
|
|
2023
|
-
|
|
1887
|
+
if (!isValid) {
|
|
1888
|
+
invalidProps.push(key);
|
|
1889
|
+
}
|
|
2024
1890
|
}
|
|
2025
|
-
}
|
|
2026
1891
|
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
1892
|
+
var unknownPropString = invalidProps.map(function (prop) {
|
|
1893
|
+
return '`' + prop + '`';
|
|
1894
|
+
}).join(', ');
|
|
2030
1895
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
1896
|
+
if (invalidProps.length === 1) {
|
|
1897
|
+
error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1898
|
+
} else if (invalidProps.length > 1) {
|
|
1899
|
+
error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1900
|
+
}
|
|
2035
1901
|
}
|
|
2036
1902
|
}
|
|
2037
1903
|
|
|
@@ -2045,48 +1911,28 @@ function validateProperties(type, props) {
|
|
|
2045
1911
|
|
|
2046
1912
|
var didWarnValueNull = false;
|
|
2047
1913
|
function validateProperties$1(type, props) {
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
1914
|
+
{
|
|
1915
|
+
if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
2051
1918
|
|
|
2052
|
-
|
|
2053
|
-
|
|
1919
|
+
if (props != null && props.value === null && !didWarnValueNull) {
|
|
1920
|
+
didWarnValueNull = true;
|
|
2054
1921
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
1922
|
+
if (type === 'select' && props.multiple) {
|
|
1923
|
+
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);
|
|
1924
|
+
} else {
|
|
1925
|
+
error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
|
|
1926
|
+
}
|
|
2059
1927
|
}
|
|
2060
1928
|
}
|
|
2061
1929
|
}
|
|
2062
1930
|
|
|
2063
|
-
/**
|
|
2064
|
-
* Registers plugins so that they can extract and dispatch events.
|
|
2065
|
-
*
|
|
2066
|
-
* @see {EventPluginHub}
|
|
2067
|
-
*/
|
|
2068
|
-
|
|
2069
|
-
/**
|
|
2070
|
-
* Ordered list of injected plugins.
|
|
2071
|
-
*/
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
/**
|
|
2076
|
-
* Mapping from event name to dispatch config
|
|
2077
|
-
*/
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
1931
|
/**
|
|
2081
1932
|
* Mapping from registration name to plugin module
|
|
2082
1933
|
*/
|
|
2083
1934
|
|
|
2084
1935
|
var registrationNameModules = {};
|
|
2085
|
-
/**
|
|
2086
|
-
* Mapping from registration name to event name
|
|
2087
|
-
*/
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
1936
|
/**
|
|
2091
1937
|
* Mapping from lowercase registration names to the properly cased version,
|
|
2092
1938
|
* used to warn in the case of missing event handlers. Available
|
|
@@ -2094,29 +1940,7 @@ var registrationNameModules = {};
|
|
|
2094
1940
|
* @type {Object}
|
|
2095
1941
|
*/
|
|
2096
1942
|
|
|
2097
|
-
var possibleRegistrationNames =
|
|
2098
|
-
|
|
2099
|
-
/**
|
|
2100
|
-
* Injects an ordering of plugins (by plugin name). This allows the ordering
|
|
2101
|
-
* to be decoupled from injection of the actual plugins so that ordering is
|
|
2102
|
-
* always deterministic regardless of packaging, on-the-fly injection, etc.
|
|
2103
|
-
*
|
|
2104
|
-
* @param {array} InjectedEventPluginOrder
|
|
2105
|
-
* @internal
|
|
2106
|
-
* @see {EventPluginHub.injection.injectEventPluginOrder}
|
|
2107
|
-
*/
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
/**
|
|
2111
|
-
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
|
|
2112
|
-
* in the ordering injected by `injectEventPluginOrder`.
|
|
2113
|
-
*
|
|
2114
|
-
* Plugins can be injected as part of page initialization or on-the-fly.
|
|
2115
|
-
*
|
|
2116
|
-
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
|
|
2117
|
-
* @internal
|
|
2118
|
-
* @see {EventPluginHub.injection.injectEventPluginsByName}
|
|
2119
|
-
*/
|
|
1943
|
+
var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true
|
|
2120
1944
|
|
|
2121
1945
|
// When adding attributes to the HTML or SVG whitelist, be sure to
|
|
2122
1946
|
// also add them to this module to ensure casing and incorrect name
|
|
@@ -2625,7 +2449,8 @@ var validateProperty$1 = function () {};
|
|
|
2625
2449
|
var lowerCasedName = name.toLowerCase();
|
|
2626
2450
|
|
|
2627
2451
|
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
2628
|
-
|
|
2452
|
+
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.');
|
|
2453
|
+
|
|
2629
2454
|
warnedProperties$1[name] = true;
|
|
2630
2455
|
return true;
|
|
2631
2456
|
} // We can't rely on the event system being injected on the server.
|
|
@@ -2639,13 +2464,15 @@ var validateProperty$1 = function () {};
|
|
|
2639
2464
|
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
|
2640
2465
|
|
|
2641
2466
|
if (registrationName != null) {
|
|
2642
|
-
|
|
2467
|
+
error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
|
2468
|
+
|
|
2643
2469
|
warnedProperties$1[name] = true;
|
|
2644
2470
|
return true;
|
|
2645
2471
|
}
|
|
2646
2472
|
|
|
2647
2473
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
2648
|
-
|
|
2474
|
+
error('Unknown event handler property `%s`. It will be ignored.', name);
|
|
2475
|
+
|
|
2649
2476
|
warnedProperties$1[name] = true;
|
|
2650
2477
|
return true;
|
|
2651
2478
|
}
|
|
@@ -2654,7 +2481,7 @@ var validateProperty$1 = function () {};
|
|
|
2654
2481
|
// So we can't tell if the event name is correct for sure, but we can filter
|
|
2655
2482
|
// out known bad ones like `onclick`. We can't suggest a specific replacement though.
|
|
2656
2483
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
2657
|
-
|
|
2484
|
+
error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
|
2658
2485
|
}
|
|
2659
2486
|
|
|
2660
2487
|
warnedProperties$1[name] = true;
|
|
@@ -2667,25 +2494,29 @@ var validateProperty$1 = function () {};
|
|
|
2667
2494
|
}
|
|
2668
2495
|
|
|
2669
2496
|
if (lowerCasedName === 'innerhtml') {
|
|
2670
|
-
|
|
2497
|
+
error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
2498
|
+
|
|
2671
2499
|
warnedProperties$1[name] = true;
|
|
2672
2500
|
return true;
|
|
2673
2501
|
}
|
|
2674
2502
|
|
|
2675
2503
|
if (lowerCasedName === 'aria') {
|
|
2676
|
-
|
|
2504
|
+
error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
2505
|
+
|
|
2677
2506
|
warnedProperties$1[name] = true;
|
|
2678
2507
|
return true;
|
|
2679
2508
|
}
|
|
2680
2509
|
|
|
2681
2510
|
if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
|
2682
|
-
|
|
2511
|
+
error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
|
2512
|
+
|
|
2683
2513
|
warnedProperties$1[name] = true;
|
|
2684
2514
|
return true;
|
|
2685
2515
|
}
|
|
2686
2516
|
|
|
2687
2517
|
if (typeof value === 'number' && isNaN(value)) {
|
|
2688
|
-
|
|
2518
|
+
error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
|
2519
|
+
|
|
2689
2520
|
warnedProperties$1[name] = true;
|
|
2690
2521
|
return true;
|
|
2691
2522
|
}
|
|
@@ -2697,23 +2528,25 @@ var validateProperty$1 = function () {};
|
|
|
2697
2528
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
2698
2529
|
|
|
2699
2530
|
if (standardName !== name) {
|
|
2700
|
-
|
|
2531
|
+
error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
|
2532
|
+
|
|
2701
2533
|
warnedProperties$1[name] = true;
|
|
2702
2534
|
return true;
|
|
2703
2535
|
}
|
|
2704
2536
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
2705
2537
|
// Unknown attributes should have lowercase casing since that's how they
|
|
2706
2538
|
// will be cased anyway with server rendering.
|
|
2707
|
-
|
|
2539
|
+
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);
|
|
2540
|
+
|
|
2708
2541
|
warnedProperties$1[name] = true;
|
|
2709
2542
|
return true;
|
|
2710
2543
|
}
|
|
2711
2544
|
|
|
2712
2545
|
if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
2713
2546
|
if (value) {
|
|
2714
|
-
|
|
2547
|
+
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);
|
|
2715
2548
|
} else {
|
|
2716
|
-
|
|
2549
|
+
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);
|
|
2717
2550
|
}
|
|
2718
2551
|
|
|
2719
2552
|
warnedProperties$1[name] = true;
|
|
@@ -2734,7 +2567,8 @@ var validateProperty$1 = function () {};
|
|
|
2734
2567
|
|
|
2735
2568
|
|
|
2736
2569
|
if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
2737
|
-
|
|
2570
|
+
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);
|
|
2571
|
+
|
|
2738
2572
|
warnedProperties$1[name] = true;
|
|
2739
2573
|
return true;
|
|
2740
2574
|
}
|
|
@@ -2744,24 +2578,26 @@ var validateProperty$1 = function () {};
|
|
|
2744
2578
|
}
|
|
2745
2579
|
|
|
2746
2580
|
var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
|
2747
|
-
|
|
2581
|
+
{
|
|
2582
|
+
var unknownProps = [];
|
|
2748
2583
|
|
|
2749
|
-
|
|
2750
|
-
|
|
2584
|
+
for (var key in props) {
|
|
2585
|
+
var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
|
2751
2586
|
|
|
2752
|
-
|
|
2753
|
-
|
|
2587
|
+
if (!isValid) {
|
|
2588
|
+
unknownProps.push(key);
|
|
2589
|
+
}
|
|
2754
2590
|
}
|
|
2755
|
-
}
|
|
2756
2591
|
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2592
|
+
var unknownPropString = unknownProps.map(function (prop) {
|
|
2593
|
+
return '`' + prop + '`';
|
|
2594
|
+
}).join(', ');
|
|
2760
2595
|
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2596
|
+
if (unknownProps.length === 1) {
|
|
2597
|
+
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);
|
|
2598
|
+
} else if (unknownProps.length > 1) {
|
|
2599
|
+
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);
|
|
2600
|
+
}
|
|
2765
2601
|
}
|
|
2766
2602
|
};
|
|
2767
2603
|
|
|
@@ -2780,7 +2616,7 @@ var toArray = React.Children.toArray; // This is only used in DEV.
|
|
|
2780
2616
|
|
|
2781
2617
|
var currentDebugStacks = [];
|
|
2782
2618
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2783
|
-
var ReactDebugCurrentFrame;
|
|
2619
|
+
var ReactDebugCurrentFrame$4;
|
|
2784
2620
|
var prevGetCurrentStackImpl = null;
|
|
2785
2621
|
|
|
2786
2622
|
var getCurrentServerStackImpl = function () {
|
|
@@ -2802,7 +2638,7 @@ var popCurrentDebugStack = function () {};
|
|
|
2802
2638
|
var hasWarnedAboutUsingContextAsConsumer = false;
|
|
2803
2639
|
|
|
2804
2640
|
{
|
|
2805
|
-
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2641
|
+
ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2806
2642
|
|
|
2807
2643
|
validatePropertiesInDevelopment = function (type, props) {
|
|
2808
2644
|
validateProperties(type, props);
|
|
@@ -2826,8 +2662,8 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2826
2662
|
if (currentDebugStacks.length === 1) {
|
|
2827
2663
|
// We are entering a server renderer.
|
|
2828
2664
|
// Remember the previous (e.g. client) global stack implementation.
|
|
2829
|
-
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
|
2830
|
-
ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
|
2665
|
+
prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack;
|
|
2666
|
+
ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl;
|
|
2831
2667
|
}
|
|
2832
2668
|
};
|
|
2833
2669
|
|
|
@@ -2848,7 +2684,7 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2848
2684
|
if (currentDebugStacks.length === 0) {
|
|
2849
2685
|
// We are exiting the server renderer.
|
|
2850
2686
|
// Restore the previous (e.g. client) global stack implementation.
|
|
2851
|
-
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
|
2687
|
+
ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl;
|
|
2852
2688
|
prevGetCurrentStackImpl = null;
|
|
2853
2689
|
}
|
|
2854
2690
|
};
|
|
@@ -2908,7 +2744,7 @@ function validateDangerousTag(tag) {
|
|
|
2908
2744
|
if (!validatedTagCache.hasOwnProperty(tag)) {
|
|
2909
2745
|
if (!VALID_TAG_REGEX.test(tag)) {
|
|
2910
2746
|
{
|
|
2911
|
-
throw Error("Invalid tag: " + tag);
|
|
2747
|
+
throw Error( "Invalid tag: " + tag );
|
|
2912
2748
|
}
|
|
2913
2749
|
}
|
|
2914
2750
|
|
|
@@ -2966,7 +2802,8 @@ function warnNoop(publicInstance, callerName) {
|
|
|
2966
2802
|
return;
|
|
2967
2803
|
}
|
|
2968
2804
|
|
|
2969
|
-
|
|
2805
|
+
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);
|
|
2806
|
+
|
|
2970
2807
|
didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
|
2971
2808
|
}
|
|
2972
2809
|
}
|
|
@@ -3032,14 +2869,15 @@ function flattenOptionChildren(children) {
|
|
|
3032
2869
|
{
|
|
3033
2870
|
if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
|
3034
2871
|
didWarnInvalidOptionChildren = true;
|
|
3035
|
-
|
|
2872
|
+
|
|
2873
|
+
error('Only strings and numbers are supported as <option> children.');
|
|
3036
2874
|
}
|
|
3037
2875
|
}
|
|
3038
2876
|
});
|
|
3039
2877
|
return content;
|
|
3040
2878
|
}
|
|
3041
2879
|
|
|
3042
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2880
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
3043
2881
|
var STYLE = 'style';
|
|
3044
2882
|
var RESERVED_PROPS = {
|
|
3045
2883
|
children: null,
|
|
@@ -3052,11 +2890,7 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
3052
2890
|
var ret = '<' + tagVerbatim;
|
|
3053
2891
|
|
|
3054
2892
|
for (var propKey in props) {
|
|
3055
|
-
if (!hasOwnProperty.call(props, propKey)) {
|
|
3056
|
-
continue;
|
|
3057
|
-
}
|
|
3058
|
-
|
|
3059
|
-
if (enableFlareAPI && propKey === 'listeners') {
|
|
2893
|
+
if (!hasOwnProperty$2.call(props, propKey)) {
|
|
3060
2894
|
continue;
|
|
3061
2895
|
}
|
|
3062
2896
|
|
|
@@ -3102,7 +2936,7 @@ function validateRenderResult(child, type) {
|
|
|
3102
2936
|
if (child === undefined) {
|
|
3103
2937
|
{
|
|
3104
2938
|
{
|
|
3105
|
-
throw Error((getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
|
|
2939
|
+
throw Error( (getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
|
|
3106
2940
|
}
|
|
3107
2941
|
}
|
|
3108
2942
|
}
|
|
@@ -3165,7 +2999,8 @@ function resolve(child, context, threadID) {
|
|
|
3165
2999
|
var componentName = getComponentName(Component) || 'Unknown';
|
|
3166
3000
|
|
|
3167
3001
|
if (!didWarnAboutUninitializedState[componentName]) {
|
|
3168
|
-
|
|
3002
|
+
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);
|
|
3003
|
+
|
|
3169
3004
|
didWarnAboutUninitializedState[componentName] = true;
|
|
3170
3005
|
}
|
|
3171
3006
|
}
|
|
@@ -3178,7 +3013,8 @@ function resolve(child, context, threadID) {
|
|
|
3178
3013
|
var _componentName = getComponentName(Component) || 'Unknown';
|
|
3179
3014
|
|
|
3180
3015
|
if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
|
3181
|
-
|
|
3016
|
+
error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
|
3017
|
+
|
|
3182
3018
|
didWarnAboutUndefinedDerivedState[_componentName] = true;
|
|
3183
3019
|
}
|
|
3184
3020
|
}
|
|
@@ -3194,7 +3030,8 @@ function resolve(child, context, threadID) {
|
|
|
3194
3030
|
var _componentName2 = getComponentName(Component) || 'Unknown';
|
|
3195
3031
|
|
|
3196
3032
|
if (!didWarnAboutBadClass[_componentName2]) {
|
|
3197
|
-
|
|
3033
|
+
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);
|
|
3034
|
+
|
|
3198
3035
|
didWarnAboutBadClass[_componentName2] = true;
|
|
3199
3036
|
}
|
|
3200
3037
|
}
|
|
@@ -3215,7 +3052,8 @@ function resolve(child, context, threadID) {
|
|
|
3215
3052
|
var _componentName3 = getComponentName(Component) || 'Unknown';
|
|
3216
3053
|
|
|
3217
3054
|
if (!didWarnAboutModulePatternComponent[_componentName3]) {
|
|
3218
|
-
|
|
3055
|
+
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);
|
|
3056
|
+
|
|
3219
3057
|
didWarnAboutModulePatternComponent[_componentName3] = true;
|
|
3220
3058
|
}
|
|
3221
3059
|
}
|
|
@@ -3233,12 +3071,13 @@ function resolve(child, context, threadID) {
|
|
|
3233
3071
|
if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
|
3234
3072
|
if (typeof inst.componentWillMount === 'function') {
|
|
3235
3073
|
{
|
|
3236
|
-
if (
|
|
3074
|
+
if ( inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
3237
3075
|
var _componentName4 = getComponentName(Component) || 'Unknown';
|
|
3238
3076
|
|
|
3239
3077
|
if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
|
|
3240
|
-
|
|
3078
|
+
warn( // keep this warning in sync with ReactStrictModeWarning.js
|
|
3241
3079
|
'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);
|
|
3080
|
+
|
|
3242
3081
|
didWarnAboutDeprecatedWillMount[_componentName4] = true;
|
|
3243
3082
|
}
|
|
3244
3083
|
}
|
|
@@ -3304,15 +3143,7 @@ function resolve(child, context, threadID) {
|
|
|
3304
3143
|
validateRenderResult(child, Component);
|
|
3305
3144
|
var childContext;
|
|
3306
3145
|
|
|
3307
|
-
|
|
3308
|
-
{
|
|
3309
|
-
var childContextTypes = Component.childContextTypes;
|
|
3310
|
-
|
|
3311
|
-
if (childContextTypes !== undefined) {
|
|
3312
|
-
warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
} else {
|
|
3146
|
+
{
|
|
3316
3147
|
if (typeof inst.getChildContext === 'function') {
|
|
3317
3148
|
var _childContextTypes = Component.childContextTypes;
|
|
3318
3149
|
|
|
@@ -3322,12 +3153,14 @@ function resolve(child, context, threadID) {
|
|
|
3322
3153
|
for (var contextKey in childContext) {
|
|
3323
3154
|
if (!(contextKey in _childContextTypes)) {
|
|
3324
3155
|
{
|
|
3325
|
-
throw Error((getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes.");
|
|
3156
|
+
throw Error( (getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
|
|
3326
3157
|
}
|
|
3327
3158
|
}
|
|
3328
3159
|
}
|
|
3329
3160
|
} else {
|
|
3330
|
-
|
|
3161
|
+
{
|
|
3162
|
+
error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
|
3163
|
+
}
|
|
3331
3164
|
}
|
|
3332
3165
|
}
|
|
3333
3166
|
|
|
@@ -3425,7 +3258,9 @@ function () {
|
|
|
3425
3258
|
var index = this.contextIndex;
|
|
3426
3259
|
|
|
3427
3260
|
{
|
|
3428
|
-
|
|
3261
|
+
if (index < 0 || provider !== this.contextProviderStack[index]) {
|
|
3262
|
+
error('Unexpected pop.');
|
|
3263
|
+
}
|
|
3429
3264
|
}
|
|
3430
3265
|
|
|
3431
3266
|
var context = this.contextStack[index];
|
|
@@ -3506,7 +3341,7 @@ function () {
|
|
|
3506
3341
|
|
|
3507
3342
|
if (!fallbackFrame) {
|
|
3508
3343
|
{
|
|
3509
|
-
throw Error("ReactDOMServer did not find an internal fallback frame for Suspense. This is a bug in React. Please file an issue.");
|
|
3344
|
+
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));
|
|
3510
3345
|
}
|
|
3511
3346
|
}
|
|
3512
3347
|
|
|
@@ -3527,7 +3362,7 @@ function () {
|
|
|
3527
3362
|
var child = frame.children[frame.childIndex++];
|
|
3528
3363
|
var outBuffer = '';
|
|
3529
3364
|
|
|
3530
|
-
{
|
|
3365
|
+
if (true) {
|
|
3531
3366
|
pushCurrentDebugStack(this.stack); // We're starting work on this frame, so reset its inner stack.
|
|
3532
3367
|
|
|
3533
3368
|
frame.debugElementStack.length = 0;
|
|
@@ -3540,15 +3375,15 @@ function () {
|
|
|
3540
3375
|
if (enableSuspenseServerRenderer) {
|
|
3541
3376
|
if (!(this.suspenseDepth > 0)) {
|
|
3542
3377
|
{
|
|
3543
|
-
throw 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.");
|
|
3378
|
+
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));
|
|
3544
3379
|
}
|
|
3545
3380
|
}
|
|
3546
3381
|
|
|
3547
3382
|
suspended = true;
|
|
3548
3383
|
} else {
|
|
3549
|
-
{
|
|
3384
|
+
if (!false) {
|
|
3550
3385
|
{
|
|
3551
|
-
throw Error("ReactDOMServer does not yet support Suspense.");
|
|
3386
|
+
throw Error(true ? "ReactDOMServer does not yet support Suspense." : formatProdErrorMessage(294));
|
|
3552
3387
|
}
|
|
3553
3388
|
}
|
|
3554
3389
|
}
|
|
@@ -3556,7 +3391,7 @@ function () {
|
|
|
3556
3391
|
throw err;
|
|
3557
3392
|
}
|
|
3558
3393
|
} finally {
|
|
3559
|
-
{
|
|
3394
|
+
if (true) {
|
|
3560
3395
|
popCurrentDebugStack();
|
|
3561
3396
|
}
|
|
3562
3397
|
}
|
|
@@ -3610,14 +3445,14 @@ function () {
|
|
|
3610
3445
|
|
|
3611
3446
|
if (!($$typeof !== REACT_PORTAL_TYPE)) {
|
|
3612
3447
|
{
|
|
3613
|
-
throw Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");
|
|
3448
|
+
throw Error( "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render." );
|
|
3614
3449
|
}
|
|
3615
3450
|
} // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
|
|
3616
3451
|
|
|
3617
3452
|
|
|
3618
3453
|
{
|
|
3619
3454
|
{
|
|
3620
|
-
throw Error("Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue.");
|
|
3455
|
+
throw Error( "Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue." );
|
|
3621
3456
|
}
|
|
3622
3457
|
}
|
|
3623
3458
|
}
|
|
@@ -3676,72 +3511,14 @@ function () {
|
|
|
3676
3511
|
|
|
3677
3512
|
case REACT_SUSPENSE_TYPE:
|
|
3678
3513
|
{
|
|
3679
|
-
|
|
3680
|
-
var fallback = nextChild.props.fallback;
|
|
3681
|
-
|
|
3682
|
-
if (fallback === undefined) {
|
|
3683
|
-
// If there is no fallback, then this just behaves as a fragment.
|
|
3684
|
-
var _nextChildren3 = toArray(nextChild.props.children);
|
|
3685
|
-
|
|
3686
|
-
var _frame3 = {
|
|
3687
|
-
type: null,
|
|
3688
|
-
domNamespace: parentNamespace,
|
|
3689
|
-
children: _nextChildren3,
|
|
3690
|
-
childIndex: 0,
|
|
3691
|
-
context: context,
|
|
3692
|
-
footer: ''
|
|
3693
|
-
};
|
|
3694
|
-
|
|
3695
|
-
{
|
|
3696
|
-
_frame3.debugElementStack = [];
|
|
3697
|
-
}
|
|
3698
|
-
|
|
3699
|
-
this.stack.push(_frame3);
|
|
3700
|
-
return '';
|
|
3701
|
-
}
|
|
3702
|
-
|
|
3703
|
-
var fallbackChildren = toArray(fallback);
|
|
3704
|
-
|
|
3705
|
-
var _nextChildren2 = toArray(nextChild.props.children);
|
|
3706
|
-
|
|
3707
|
-
var fallbackFrame = {
|
|
3708
|
-
type: null,
|
|
3709
|
-
domNamespace: parentNamespace,
|
|
3710
|
-
children: fallbackChildren,
|
|
3711
|
-
childIndex: 0,
|
|
3712
|
-
context: context,
|
|
3713
|
-
footer: '<!--/$-->'
|
|
3714
|
-
};
|
|
3715
|
-
var _frame2 = {
|
|
3716
|
-
fallbackFrame: fallbackFrame,
|
|
3717
|
-
type: REACT_SUSPENSE_TYPE,
|
|
3718
|
-
domNamespace: parentNamespace,
|
|
3719
|
-
children: _nextChildren2,
|
|
3720
|
-
childIndex: 0,
|
|
3721
|
-
context: context,
|
|
3722
|
-
footer: '<!--/$-->'
|
|
3723
|
-
};
|
|
3724
|
-
|
|
3725
|
-
{
|
|
3726
|
-
_frame2.debugElementStack = [];
|
|
3727
|
-
fallbackFrame.debugElementStack = [];
|
|
3728
|
-
}
|
|
3729
|
-
|
|
3730
|
-
this.stack.push(_frame2);
|
|
3731
|
-
this.suspenseDepth++;
|
|
3732
|
-
return '<!--$-->';
|
|
3733
|
-
} else {
|
|
3514
|
+
{
|
|
3734
3515
|
{
|
|
3735
3516
|
{
|
|
3736
|
-
throw Error("ReactDOMServer does not yet support Suspense.");
|
|
3517
|
+
throw Error( "ReactDOMServer does not yet support Suspense." );
|
|
3737
3518
|
}
|
|
3738
3519
|
}
|
|
3739
3520
|
}
|
|
3740
3521
|
}
|
|
3741
|
-
// eslint-disable-next-line-no-fallthrough
|
|
3742
|
-
|
|
3743
|
-
default:
|
|
3744
|
-
break;
|
|
3745
3522
|
}
|
|
3746
3523
|
|
|
3747
3524
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
@@ -3840,7 +3617,8 @@ function () {
|
|
|
3840
3617
|
if (reactContext !== reactContext.Consumer) {
|
|
3841
3618
|
if (!hasWarnedAboutUsingContextAsConsumer) {
|
|
3842
3619
|
hasWarnedAboutUsingContextAsConsumer = true;
|
|
3843
|
-
|
|
3620
|
+
|
|
3621
|
+
error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
3844
3622
|
}
|
|
3845
3623
|
}
|
|
3846
3624
|
} else {
|
|
@@ -3875,34 +3653,10 @@ function () {
|
|
|
3875
3653
|
|
|
3876
3654
|
case REACT_FUNDAMENTAL_TYPE:
|
|
3877
3655
|
{
|
|
3878
|
-
if (enableFundamentalAPI) {
|
|
3879
|
-
var fundamentalImpl = elementType.impl;
|
|
3880
|
-
var open = fundamentalImpl.getServerSideString(null, nextElement.props);
|
|
3881
|
-
var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
|
|
3882
|
-
var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
|
|
3883
|
-
|
|
3884
|
-
var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
|
|
3885
|
-
|
|
3886
|
-
var _frame8 = {
|
|
3887
|
-
type: null,
|
|
3888
|
-
domNamespace: parentNamespace,
|
|
3889
|
-
children: _nextChildren8,
|
|
3890
|
-
childIndex: 0,
|
|
3891
|
-
context: context,
|
|
3892
|
-
footer: close
|
|
3893
|
-
};
|
|
3894
|
-
|
|
3895
|
-
{
|
|
3896
|
-
_frame8.debugElementStack = [];
|
|
3897
|
-
}
|
|
3898
|
-
|
|
3899
|
-
this.stack.push(_frame8);
|
|
3900
|
-
return open;
|
|
3901
|
-
}
|
|
3902
3656
|
|
|
3903
3657
|
{
|
|
3904
3658
|
{
|
|
3905
|
-
throw Error("ReactDOMServer does not yet support the fundamental API.");
|
|
3659
|
+
throw Error( "ReactDOMServer does not yet support the fundamental API." );
|
|
3906
3660
|
}
|
|
3907
3661
|
}
|
|
3908
3662
|
}
|
|
@@ -3947,7 +3701,7 @@ function () {
|
|
|
3947
3701
|
default:
|
|
3948
3702
|
{
|
|
3949
3703
|
{
|
|
3950
|
-
throw Error("ReactDOMServer does not yet support lazy-loaded components.");
|
|
3704
|
+
throw Error( "ReactDOMServer does not yet support lazy-loaded components." );
|
|
3951
3705
|
}
|
|
3952
3706
|
}
|
|
3953
3707
|
|
|
@@ -3957,29 +3711,10 @@ function () {
|
|
|
3957
3711
|
|
|
3958
3712
|
case REACT_SCOPE_TYPE:
|
|
3959
3713
|
{
|
|
3960
|
-
if (enableScopeAPI) {
|
|
3961
|
-
var _nextChildren10 = toArray(nextChild.props.children);
|
|
3962
|
-
|
|
3963
|
-
var _frame10 = {
|
|
3964
|
-
type: null,
|
|
3965
|
-
domNamespace: parentNamespace,
|
|
3966
|
-
children: _nextChildren10,
|
|
3967
|
-
childIndex: 0,
|
|
3968
|
-
context: context,
|
|
3969
|
-
footer: ''
|
|
3970
|
-
};
|
|
3971
|
-
|
|
3972
|
-
{
|
|
3973
|
-
_frame10.debugElementStack = [];
|
|
3974
|
-
}
|
|
3975
|
-
|
|
3976
|
-
this.stack.push(_frame10);
|
|
3977
|
-
return '';
|
|
3978
|
-
}
|
|
3979
3714
|
|
|
3980
3715
|
{
|
|
3981
3716
|
{
|
|
3982
|
-
throw Error("ReactDOMServer does not yet support scope components.");
|
|
3717
|
+
throw Error( "ReactDOMServer does not yet support scope components." );
|
|
3983
3718
|
}
|
|
3984
3719
|
}
|
|
3985
3720
|
}
|
|
@@ -4004,7 +3739,7 @@ function () {
|
|
|
4004
3739
|
|
|
4005
3740
|
{
|
|
4006
3741
|
{
|
|
4007
|
-
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);
|
|
3742
|
+
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 );
|
|
4008
3743
|
}
|
|
4009
3744
|
}
|
|
4010
3745
|
}
|
|
@@ -4022,7 +3757,9 @@ function () {
|
|
|
4022
3757
|
if (namespace === Namespaces.html) {
|
|
4023
3758
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
4024
3759
|
// allow <SVG> or <mATH>.
|
|
4025
|
-
|
|
3760
|
+
if (tag !== element.type) {
|
|
3761
|
+
error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type);
|
|
3762
|
+
}
|
|
4026
3763
|
}
|
|
4027
3764
|
}
|
|
4028
3765
|
|
|
@@ -4034,12 +3771,14 @@ function () {
|
|
|
4034
3771
|
ReactControlledValuePropTypes.checkPropTypes('input', props);
|
|
4035
3772
|
|
|
4036
3773
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
|
4037
|
-
|
|
3774
|
+
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);
|
|
3775
|
+
|
|
4038
3776
|
didWarnDefaultChecked = true;
|
|
4039
3777
|
}
|
|
4040
3778
|
|
|
4041
3779
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
|
4042
|
-
|
|
3780
|
+
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);
|
|
3781
|
+
|
|
4043
3782
|
didWarnDefaultInputValue = true;
|
|
4044
3783
|
}
|
|
4045
3784
|
}
|
|
@@ -4057,7 +3796,8 @@ function () {
|
|
|
4057
3796
|
ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
|
4058
3797
|
|
|
4059
3798
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
|
4060
|
-
|
|
3799
|
+
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');
|
|
3800
|
+
|
|
4061
3801
|
didWarnDefaultTextareaValue = true;
|
|
4062
3802
|
}
|
|
4063
3803
|
}
|
|
@@ -4071,19 +3811,19 @@ function () {
|
|
|
4071
3811
|
|
|
4072
3812
|
if (textareaChildren != null) {
|
|
4073
3813
|
{
|
|
4074
|
-
|
|
3814
|
+
error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
4075
3815
|
}
|
|
4076
3816
|
|
|
4077
3817
|
if (!(defaultValue == null)) {
|
|
4078
3818
|
{
|
|
4079
|
-
throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
|
|
3819
|
+
throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
|
|
4080
3820
|
}
|
|
4081
3821
|
}
|
|
4082
3822
|
|
|
4083
3823
|
if (Array.isArray(textareaChildren)) {
|
|
4084
3824
|
if (!(textareaChildren.length <= 1)) {
|
|
4085
3825
|
{
|
|
4086
|
-
throw Error("<textarea> can only have at most one child.");
|
|
3826
|
+
throw Error( "<textarea> can only have at most one child." );
|
|
4087
3827
|
}
|
|
4088
3828
|
}
|
|
4089
3829
|
|
|
@@ -4118,14 +3858,15 @@ function () {
|
|
|
4118
3858
|
var isArray = Array.isArray(props[propName]);
|
|
4119
3859
|
|
|
4120
3860
|
if (props.multiple && !isArray) {
|
|
4121
|
-
|
|
3861
|
+
error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
|
4122
3862
|
} else if (!props.multiple && isArray) {
|
|
4123
|
-
|
|
3863
|
+
error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
|
4124
3864
|
}
|
|
4125
3865
|
}
|
|
4126
3866
|
|
|
4127
3867
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
|
4128
|
-
|
|
3868
|
+
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');
|
|
3869
|
+
|
|
4129
3870
|
didWarnDefaultSelectValue = true;
|
|
4130
3871
|
}
|
|
4131
3872
|
}
|
|
@@ -4193,7 +3934,7 @@ function () {
|
|
|
4193
3934
|
if (innerMarkup != null) {
|
|
4194
3935
|
children = [];
|
|
4195
3936
|
|
|
4196
|
-
if (newlineEatingTags
|
|
3937
|
+
if (newlineEatingTags.hasOwnProperty(tag) && innerMarkup.charAt(0) === '\n') {
|
|
4197
3938
|
// text/html ignores the first character in these tags if it's a newline
|
|
4198
3939
|
// Prefer to break application/xml over text/html (for now) by adding
|
|
4199
3940
|
// a newline specifically to get eaten by the parser. (Alternately for
|
|
@@ -4269,7 +4010,7 @@ function renderToStaticMarkup(element) {
|
|
|
4269
4010
|
function renderToNodeStream() {
|
|
4270
4011
|
{
|
|
4271
4012
|
{
|
|
4272
|
-
throw Error("ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.");
|
|
4013
|
+
throw Error( "ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead." );
|
|
4273
4014
|
}
|
|
4274
4015
|
}
|
|
4275
4016
|
}
|
|
@@ -4277,13 +4018,13 @@ function renderToNodeStream() {
|
|
|
4277
4018
|
function renderToStaticNodeStream() {
|
|
4278
4019
|
{
|
|
4279
4020
|
{
|
|
4280
|
-
throw Error("ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.");
|
|
4021
|
+
throw Error( "ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead." );
|
|
4281
4022
|
}
|
|
4282
4023
|
}
|
|
4283
4024
|
} // Note: when changing this, also consider https://github.com/facebook/react/issues/11526
|
|
4284
4025
|
|
|
4285
4026
|
|
|
4286
|
-
var
|
|
4027
|
+
var ReactDOMServer = {
|
|
4287
4028
|
renderToString: renderToString,
|
|
4288
4029
|
renderToStaticMarkup: renderToStaticMarkup,
|
|
4289
4030
|
renderToNodeStream: renderToNodeStream,
|
|
@@ -4291,12 +4032,6 @@ var ReactDOMServerBrowser = {
|
|
|
4291
4032
|
version: ReactVersion
|
|
4292
4033
|
};
|
|
4293
4034
|
|
|
4294
|
-
var ReactDOMServerBrowser$1 = Object.freeze({
|
|
4295
|
-
default: ReactDOMServerBrowser
|
|
4296
|
-
});
|
|
4297
|
-
|
|
4298
|
-
var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || ReactDOMServerBrowser$1;
|
|
4299
|
-
|
|
4300
4035
|
// TODO: decide on the top-level export form.
|
|
4301
4036
|
// This is hacky but makes it work with both Rollup and Jest
|
|
4302
4037
|
|