react-dom 16.12.0 → 16.13.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 +4 -4
- package/cjs/react-dom-server.browser.development.js +331 -594
- package/cjs/react-dom-server.browser.production.min.js +37 -37
- package/cjs/react-dom-server.node.development.js +330 -593
- package/cjs/react-dom-server.node.production.min.js +38 -38
- package/cjs/react-dom-test-utils.development.js +171 -328
- package/cjs/react-dom-test-utils.production.min.js +17 -17
- package/cjs/react-dom-unstable-fizz.browser.development.js +3 -21
- package/cjs/react-dom-unstable-fizz.browser.production.min.js +2 -2
- package/cjs/react-dom-unstable-fizz.node.development.js +2 -18
- package/cjs/react-dom-unstable-fizz.node.production.min.js +3 -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 +11227 -13976
- package/cjs/react-dom.production.min.js +280 -278
- package/cjs/react-dom.profiling.min.js +287 -284
- package/package.json +3 -8
- package/umd/react-dom-server.browser.development.js +3320 -3594
- package/umd/react-dom-server.browser.production.min.js +35 -35
- package/umd/react-dom-test-utils.development.js +1200 -1357
- package/umd/react-dom-test-utils.production.min.js +23 -23
- package/umd/react-dom-unstable-fizz.browser.development.js +105 -123
- 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 +19953 -22713
- package/umd/react-dom.production.min.js +229 -232
- package/umd/react-dom.profiling.min.js +236 -239
- package/cjs/react-dom-unstable-flight-client.development.js +0 -357
- package/cjs/react-dom-unstable-flight-client.production.min.js +0 -16
- package/cjs/react-dom-unstable-flight-server.browser.development.js +0 -392
- package/cjs/react-dom-unstable-flight-server.browser.production.min.js +0 -16
- package/cjs/react-dom-unstable-flight-server.node.development.js +0 -415
- package/cjs/react-dom-unstable-flight-server.node.production.min.js +0 -16
- package/umd/react-dom-unstable-flight-client.development.js +0 -357
- package/umd/react-dom-unstable-flight-client.production.min.js +0 -14
- package/umd/react-dom-unstable-flight-server.browser.development.js +0 -390
- package/umd/react-dom-unstable-flight-server.browser.production.min.js +0 -14
- package/unstable-flight-client.js +0 -7
- package/unstable-flight-server.browser.js +0 -7
- package/unstable-flight-server.js +0 -3
- package/unstable-flight-server.node.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.13.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.13.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,71 +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 render-phase lifecycle hooks and setState
|
|
360
|
-
// reducers by double invoking them in Strict Mode.
|
|
361
|
-
|
|
362
|
-
// To preserve the "Pause on caught exceptions" behavior of the debugger, we
|
|
363
|
-
// replay the begin phase of a failed component inside invokeGuardedCallback.
|
|
364
|
-
|
|
365
|
-
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
366
|
-
|
|
367
|
-
var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
|
|
368
|
-
|
|
369
|
-
// Trace which interactions trigger each commit.
|
|
370
|
-
|
|
371
|
-
// SSR experiments
|
|
280
|
+
}
|
|
372
281
|
|
|
373
282
|
var enableSuspenseServerRenderer = false;
|
|
374
|
-
// Only used in www builds.
|
|
375
|
-
|
|
376
|
-
// Only used in www builds.
|
|
377
|
-
|
|
378
|
-
// Disable javascript: URL strings in href for XSS protection.
|
|
379
|
-
|
|
380
|
-
var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
|
|
381
|
-
// with their related DOM properties
|
|
382
|
-
|
|
383
|
-
// These APIs will no longer be "unstable" in the upcoming 16.7 release,
|
|
384
|
-
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
// Experimental React Flare event system and event components support.
|
|
388
|
-
|
|
389
|
-
var enableFlareAPI = false; // Experimental Host Component support.
|
|
390
283
|
|
|
391
|
-
var
|
|
284
|
+
var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
|
|
392
285
|
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
// We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
|
|
396
|
-
// Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
|
|
397
|
-
|
|
398
|
-
// For tests, we flush suspense fallbacks in an act scope;
|
|
399
|
-
// *except* in some of our own tests, where we test incremental loading states.
|
|
400
|
-
|
|
401
|
-
// Add a callback property to suspense to notify which promises are currently
|
|
402
|
-
// in the update queue. This allows reporting and tracing of what is causing
|
|
403
|
-
// the user to see a loading state.
|
|
404
|
-
// Also allows hydration callbacks to fire when a dehydrated boundary gets
|
|
405
|
-
// hydrated or deleted.
|
|
406
|
-
|
|
407
|
-
// Part of the simplification of React.createElement so we can eventually move
|
|
408
|
-
// from React.createElement to React.jsx
|
|
409
|
-
// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
var disableLegacyContext = false;
|
|
414
|
-
|
|
415
|
-
// Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
|
|
416
|
-
|
|
417
|
-
var ReactDebugCurrentFrame$1;
|
|
286
|
+
var ReactDebugCurrentFrame;
|
|
418
287
|
var didWarnAboutInvalidateContextType;
|
|
419
288
|
|
|
420
289
|
{
|
|
421
|
-
ReactDebugCurrentFrame
|
|
290
|
+
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
422
291
|
didWarnAboutInvalidateContextType = new Set();
|
|
423
292
|
}
|
|
424
293
|
|
|
@@ -446,7 +315,7 @@ function maskContext(type, context) {
|
|
|
446
315
|
|
|
447
316
|
function checkContextTypes(typeSpecs, values, location) {
|
|
448
317
|
{
|
|
449
|
-
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame
|
|
318
|
+
checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack);
|
|
450
319
|
}
|
|
451
320
|
}
|
|
452
321
|
|
|
@@ -489,7 +358,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
489
358
|
addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
|
|
490
359
|
}
|
|
491
360
|
|
|
492
|
-
|
|
361
|
+
error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
|
|
493
362
|
}
|
|
494
363
|
}
|
|
495
364
|
}
|
|
@@ -499,15 +368,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
499
368
|
return contextType[threadID];
|
|
500
369
|
}
|
|
501
370
|
|
|
502
|
-
|
|
503
|
-
{
|
|
504
|
-
if (type.contextTypes) {
|
|
505
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
return emptyObject;
|
|
510
|
-
} else {
|
|
371
|
+
{
|
|
511
372
|
var maskedContext = maskContext(type, context);
|
|
512
373
|
|
|
513
374
|
{
|
|
@@ -519,15 +380,7 @@ function processContext(type, context, threadID, isClass) {
|
|
|
519
380
|
return maskedContext;
|
|
520
381
|
}
|
|
521
382
|
} else {
|
|
522
|
-
|
|
523
|
-
{
|
|
524
|
-
if (type.contextTypes) {
|
|
525
|
-
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
return undefined;
|
|
530
|
-
} else {
|
|
383
|
+
{
|
|
531
384
|
var _maskedContext = maskContext(type, context);
|
|
532
385
|
|
|
533
386
|
{
|
|
@@ -541,9 +394,6 @@ function processContext(type, context, threadID, isClass) {
|
|
|
541
394
|
}
|
|
542
395
|
}
|
|
543
396
|
|
|
544
|
-
// Allocates a new index for each request. Tries to stay as compact as possible so that these
|
|
545
|
-
// indices can be used to reference a tightly packed array. As opposed to being used in a Map.
|
|
546
|
-
// The first allocated index is 1.
|
|
547
397
|
var nextAvailableThreadIDs = new Uint16Array(16);
|
|
548
398
|
|
|
549
399
|
for (var i = 0; i < 15; i++) {
|
|
@@ -559,7 +409,7 @@ function growThreadCountAndReturnNextAvailable() {
|
|
|
559
409
|
|
|
560
410
|
if (!(newSize <= 0x10000)) {
|
|
561
411
|
{
|
|
562
|
-
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." );
|
|
563
413
|
}
|
|
564
414
|
}
|
|
565
415
|
|
|
@@ -623,18 +473,17 @@ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\
|
|
|
623
473
|
/* eslint-enable max-len */
|
|
624
474
|
|
|
625
475
|
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
626
|
-
|
|
627
476
|
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
|
628
477
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
629
|
-
var hasOwnProperty
|
|
478
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
630
479
|
var illegalAttributeNameCache = {};
|
|
631
480
|
var validatedAttributeNameCache = {};
|
|
632
481
|
function isAttributeNameSafe(attributeName) {
|
|
633
|
-
if (hasOwnProperty
|
|
482
|
+
if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
|
634
483
|
return true;
|
|
635
484
|
}
|
|
636
485
|
|
|
637
|
-
if (hasOwnProperty
|
|
486
|
+
if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
|
638
487
|
return false;
|
|
639
488
|
}
|
|
640
489
|
|
|
@@ -646,7 +495,7 @@ function isAttributeNameSafe(attributeName) {
|
|
|
646
495
|
illegalAttributeNameCache[attributeName] = true;
|
|
647
496
|
|
|
648
497
|
{
|
|
649
|
-
|
|
498
|
+
error('Invalid attribute name: `%s`', attributeName);
|
|
650
499
|
}
|
|
651
500
|
|
|
652
501
|
return false;
|
|
@@ -746,10 +595,12 @@ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attribut
|
|
|
746
595
|
|
|
747
596
|
var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
|
|
748
597
|
|
|
749
|
-
['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
|
|
750
599
|
// elements (not just inputs). Now that ReactDOMInput assigns to the
|
|
751
600
|
// defaultValue property -- do we need this?
|
|
752
|
-
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']
|
|
601
|
+
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
|
|
602
|
+
|
|
603
|
+
reservedProps.forEach(function (name) {
|
|
753
604
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
754
605
|
name, // attributeName
|
|
755
606
|
null, // attributeNamespace
|
|
@@ -798,7 +649,10 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
798
649
|
|
|
799
650
|
['checked', // Note: `option.selected` is not updated if `select.multiple` is
|
|
800
651
|
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
801
|
-
'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) {
|
|
802
656
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
803
657
|
name, // attributeName
|
|
804
658
|
null, // attributeNamespace
|
|
@@ -806,14 +660,20 @@ var properties = {}; // These props are reserved by React. They shouldn't be wri
|
|
|
806
660
|
}); // These are HTML attributes that are "overloaded booleans": they behave like
|
|
807
661
|
// booleans, but can also accept a string value.
|
|
808
662
|
|
|
809
|
-
['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) {
|
|
810
667
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
811
668
|
name, // attributeName
|
|
812
669
|
null, // attributeNamespace
|
|
813
670
|
false);
|
|
814
671
|
}); // These are HTML attributes that must be positive numbers.
|
|
815
672
|
|
|
816
|
-
['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) {
|
|
817
677
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
818
678
|
name, // attributeName
|
|
819
679
|
null, // attributeNamespace
|
|
@@ -834,23 +694,32 @@ var capitalize = function (token) {
|
|
|
834
694
|
// or boolean value assignment. Regular attributes that just accept strings
|
|
835
695
|
// and have the same names are omitted, just like in the HTML whitelist.
|
|
836
696
|
// Some of these attributes can be hard to find. This list was created by
|
|
837
|
-
//
|
|
697
|
+
// scraping the MDN documentation.
|
|
838
698
|
|
|
839
699
|
|
|
840
|
-
['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) {
|
|
841
704
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
842
705
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
843
706
|
attributeName, null, // attributeNamespace
|
|
844
707
|
false);
|
|
845
708
|
}); // String SVG attributes with the xlink namespace.
|
|
846
709
|
|
|
847
|
-
['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) {
|
|
848
714
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
849
715
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
850
716
|
attributeName, 'http://www.w3.org/1999/xlink', false);
|
|
851
717
|
}); // String SVG attributes with the xml namespace.
|
|
852
718
|
|
|
853
|
-
['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) {
|
|
854
723
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
855
724
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
856
725
|
attributeName, 'http://www.w3.org/XML/1998/namespace', false);
|
|
@@ -876,10 +745,10 @@ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mu
|
|
|
876
745
|
true);
|
|
877
746
|
});
|
|
878
747
|
|
|
879
|
-
var ReactDebugCurrentFrame$
|
|
748
|
+
var ReactDebugCurrentFrame$1 = null;
|
|
880
749
|
|
|
881
750
|
{
|
|
882
|
-
ReactDebugCurrentFrame$
|
|
751
|
+
ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
883
752
|
} // A javascript: URL can contain leading C0 control or \u0020 SPACE,
|
|
884
753
|
// and any newline or tab are filtered out as if they're not part of the URL.
|
|
885
754
|
// https://url.spec.whatwg.org/#url-parsing
|
|
@@ -896,15 +765,12 @@ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r
|
|
|
896
765
|
var didWarn = false;
|
|
897
766
|
|
|
898
767
|
function sanitizeURL(url) {
|
|
899
|
-
|
|
900
|
-
if (
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
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));
|
|
904
773
|
}
|
|
905
|
-
} else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
|
|
906
|
-
didWarn = true;
|
|
907
|
-
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));
|
|
908
774
|
}
|
|
909
775
|
}
|
|
910
776
|
|
|
@@ -1009,18 +875,6 @@ function quoteAttributeValueForBrowser(value) {
|
|
|
1009
875
|
return '"' + escapeTextForBrowser(value) + '"';
|
|
1010
876
|
}
|
|
1011
877
|
|
|
1012
|
-
/**
|
|
1013
|
-
* Operations for dealing with DOM properties.
|
|
1014
|
-
*/
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* Creates markup for the ID property.
|
|
1018
|
-
*
|
|
1019
|
-
* @param {string} id Unescaped ID.
|
|
1020
|
-
* @return {string} Markup string.
|
|
1021
|
-
*/
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
878
|
function createMarkupForRoot() {
|
|
1025
879
|
return ROOT_ATTRIBUTE_NAME + '=""';
|
|
1026
880
|
}
|
|
@@ -1088,7 +942,7 @@ function is(x, y) {
|
|
|
1088
942
|
;
|
|
1089
943
|
}
|
|
1090
944
|
|
|
1091
|
-
var
|
|
945
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
1092
946
|
|
|
1093
947
|
var currentlyRenderingComponent = null;
|
|
1094
948
|
var firstWorkInProgressHook = null;
|
|
@@ -1109,12 +963,14 @@ var currentHookNameInDev;
|
|
|
1109
963
|
function resolveCurrentlyRenderingComponent() {
|
|
1110
964
|
if (!(currentlyRenderingComponent !== null)) {
|
|
1111
965
|
{
|
|
1112
|
-
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." );
|
|
1113
967
|
}
|
|
1114
968
|
}
|
|
1115
969
|
|
|
1116
970
|
{
|
|
1117
|
-
|
|
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
|
+
}
|
|
1118
974
|
}
|
|
1119
975
|
|
|
1120
976
|
return currentlyRenderingComponent;
|
|
@@ -1123,7 +979,7 @@ function resolveCurrentlyRenderingComponent() {
|
|
|
1123
979
|
function areHookInputsEqual(nextDeps, prevDeps) {
|
|
1124
980
|
if (prevDeps === null) {
|
|
1125
981
|
{
|
|
1126
|
-
|
|
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);
|
|
1127
983
|
}
|
|
1128
984
|
|
|
1129
985
|
return false;
|
|
@@ -1133,12 +989,12 @@ function areHookInputsEqual(nextDeps, prevDeps) {
|
|
|
1133
989
|
// Don't bother comparing lengths in prod because these arrays should be
|
|
1134
990
|
// passed inline.
|
|
1135
991
|
if (nextDeps.length !== prevDeps.length) {
|
|
1136
|
-
|
|
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(', ') + "]");
|
|
1137
993
|
}
|
|
1138
994
|
}
|
|
1139
995
|
|
|
1140
996
|
for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
|
1141
|
-
if (
|
|
997
|
+
if (objectIs(nextDeps[i], prevDeps[i])) {
|
|
1142
998
|
continue;
|
|
1143
999
|
}
|
|
1144
1000
|
|
|
@@ -1152,7 +1008,7 @@ function createHook() {
|
|
|
1152
1008
|
if (numberOfReRenders > 0) {
|
|
1153
1009
|
{
|
|
1154
1010
|
{
|
|
1155
|
-
throw Error("Rendered more hooks than during the previous render");
|
|
1011
|
+
throw Error( "Rendered more hooks than during the previous render" );
|
|
1156
1012
|
}
|
|
1157
1013
|
}
|
|
1158
1014
|
}
|
|
@@ -1243,7 +1099,9 @@ function readContext(context, observedBits) {
|
|
|
1243
1099
|
validateContextBounds(context, threadID);
|
|
1244
1100
|
|
|
1245
1101
|
{
|
|
1246
|
-
|
|
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
|
+
}
|
|
1247
1105
|
}
|
|
1248
1106
|
|
|
1249
1107
|
return context[threadID];
|
|
@@ -1261,6 +1119,7 @@ function useContext(context, observedBits) {
|
|
|
1261
1119
|
}
|
|
1262
1120
|
|
|
1263
1121
|
function basicStateReducer(state, action) {
|
|
1122
|
+
// $FlowFixMe: Flow doesn't like mixed types
|
|
1264
1123
|
return typeof action === 'function' ? action(state) : action;
|
|
1265
1124
|
}
|
|
1266
1125
|
|
|
@@ -1410,15 +1269,15 @@ function useRef(initialValue) {
|
|
|
1410
1269
|
function useLayoutEffect(create, inputs) {
|
|
1411
1270
|
{
|
|
1412
1271
|
currentHookNameInDev = 'useLayoutEffect';
|
|
1413
|
-
}
|
|
1414
1272
|
|
|
1415
|
-
|
|
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
|
+
}
|
|
1416
1275
|
}
|
|
1417
1276
|
|
|
1418
1277
|
function dispatchAction(componentIdentity, queue, action) {
|
|
1419
1278
|
if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
1420
1279
|
{
|
|
1421
|
-
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." );
|
|
1422
1281
|
}
|
|
1423
1282
|
}
|
|
1424
1283
|
|
|
@@ -1450,9 +1309,6 @@ function dispatchAction(componentIdentity, queue, action) {
|
|
|
1450
1309
|
|
|
1451
1310
|
lastRenderPhaseUpdate.next = update;
|
|
1452
1311
|
}
|
|
1453
|
-
} else {// This means an update has happened after the function component has
|
|
1454
|
-
// returned. On the server this is a no-op. In React Fiber, the update
|
|
1455
|
-
// would be scheduled for a future render.
|
|
1456
1312
|
}
|
|
1457
1313
|
}
|
|
1458
1314
|
|
|
@@ -1545,13 +1401,13 @@ function getChildNamespace(parentNamespace, type) {
|
|
|
1545
1401
|
return parentNamespace;
|
|
1546
1402
|
}
|
|
1547
1403
|
|
|
1548
|
-
var ReactDebugCurrentFrame$
|
|
1404
|
+
var ReactDebugCurrentFrame$2 = null;
|
|
1549
1405
|
var ReactControlledValuePropTypes = {
|
|
1550
1406
|
checkPropTypes: null
|
|
1551
1407
|
};
|
|
1552
1408
|
|
|
1553
1409
|
{
|
|
1554
|
-
ReactDebugCurrentFrame$
|
|
1410
|
+
ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1555
1411
|
var hasReadOnlyValue = {
|
|
1556
1412
|
button: true,
|
|
1557
1413
|
checkbox: true,
|
|
@@ -1563,14 +1419,14 @@ var ReactControlledValuePropTypes = {
|
|
|
1563
1419
|
};
|
|
1564
1420
|
var propTypes = {
|
|
1565
1421
|
value: function (props, propName, componentName) {
|
|
1566
|
-
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 ) {
|
|
1567
1423
|
return null;
|
|
1568
1424
|
}
|
|
1569
1425
|
|
|
1570
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`.');
|
|
1571
1427
|
},
|
|
1572
1428
|
checked: function (props, propName, componentName) {
|
|
1573
|
-
if (props.onChange || props.readOnly || props.disabled || props[propName] == null ||
|
|
1429
|
+
if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
|
|
1574
1430
|
return null;
|
|
1575
1431
|
}
|
|
1576
1432
|
|
|
@@ -1583,7 +1439,7 @@ var ReactControlledValuePropTypes = {
|
|
|
1583
1439
|
*/
|
|
1584
1440
|
|
|
1585
1441
|
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
|
1586
|
-
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$
|
|
1442
|
+
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
|
|
1587
1443
|
};
|
|
1588
1444
|
}
|
|
1589
1445
|
|
|
@@ -1614,13 +1470,11 @@ var voidElementTags = _assign({
|
|
|
1614
1470
|
menuitem: true
|
|
1615
1471
|
}, omittedCloseTags);
|
|
1616
1472
|
|
|
1617
|
-
// or add stack by default to invariants where possible.
|
|
1618
|
-
|
|
1619
1473
|
var HTML = '__html';
|
|
1620
|
-
var ReactDebugCurrentFrame$
|
|
1474
|
+
var ReactDebugCurrentFrame$3 = null;
|
|
1621
1475
|
|
|
1622
1476
|
{
|
|
1623
|
-
ReactDebugCurrentFrame$
|
|
1477
|
+
ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1624
1478
|
}
|
|
1625
1479
|
|
|
1626
1480
|
function assertValidProps(tag, props) {
|
|
@@ -1632,7 +1486,7 @@ function assertValidProps(tag, props) {
|
|
|
1632
1486
|
if (voidElementTags[tag]) {
|
|
1633
1487
|
if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
|
|
1634
1488
|
{
|
|
1635
|
-
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() ) );
|
|
1636
1490
|
}
|
|
1637
1491
|
}
|
|
1638
1492
|
}
|
|
@@ -1640,24 +1494,26 @@ function assertValidProps(tag, props) {
|
|
|
1640
1494
|
if (props.dangerouslySetInnerHTML != null) {
|
|
1641
1495
|
if (!(props.children == null)) {
|
|
1642
1496
|
{
|
|
1643
|
-
throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
|
|
1497
|
+
throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
|
|
1644
1498
|
}
|
|
1645
1499
|
}
|
|
1646
1500
|
|
|
1647
1501
|
if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
|
|
1648
1502
|
{
|
|
1649
|
-
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." );
|
|
1650
1504
|
}
|
|
1651
1505
|
}
|
|
1652
1506
|
}
|
|
1653
1507
|
|
|
1654
1508
|
{
|
|
1655
|
-
!
|
|
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
|
+
}
|
|
1656
1512
|
}
|
|
1657
1513
|
|
|
1658
1514
|
if (!(props.style == null || typeof props.style === 'object')) {
|
|
1659
1515
|
{
|
|
1660
|
-
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() ) );
|
|
1661
1517
|
}
|
|
1662
1518
|
}
|
|
1663
1519
|
}
|
|
@@ -1839,7 +1695,8 @@ var warnValidStyle = function () {};
|
|
|
1839
1695
|
}
|
|
1840
1696
|
|
|
1841
1697
|
warnedStyleNames[name] = true;
|
|
1842
|
-
|
|
1698
|
+
|
|
1699
|
+
error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
|
|
1843
1700
|
// (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
1844
1701
|
// is converted to lowercase `ms`.
|
|
1845
1702
|
camelize(name.replace(msPattern$1, 'ms-')));
|
|
@@ -1851,7 +1708,8 @@ var warnValidStyle = function () {};
|
|
|
1851
1708
|
}
|
|
1852
1709
|
|
|
1853
1710
|
warnedStyleNames[name] = true;
|
|
1854
|
-
|
|
1711
|
+
|
|
1712
|
+
error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
1855
1713
|
};
|
|
1856
1714
|
|
|
1857
1715
|
var warnStyleValueWithSemicolon = function (name, value) {
|
|
@@ -1860,7 +1718,8 @@ var warnValidStyle = function () {};
|
|
|
1860
1718
|
}
|
|
1861
1719
|
|
|
1862
1720
|
warnedStyleValues[value] = true;
|
|
1863
|
-
|
|
1721
|
+
|
|
1722
|
+
error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
|
1864
1723
|
};
|
|
1865
1724
|
|
|
1866
1725
|
var warnStyleValueIsNaN = function (name, value) {
|
|
@@ -1869,7 +1728,8 @@ var warnValidStyle = function () {};
|
|
|
1869
1728
|
}
|
|
1870
1729
|
|
|
1871
1730
|
warnedForNaNValue = true;
|
|
1872
|
-
|
|
1731
|
+
|
|
1732
|
+
error('`NaN` is an invalid value for the `%s` css style property.', name);
|
|
1873
1733
|
};
|
|
1874
1734
|
|
|
1875
1735
|
var warnStyleValueIsInfinity = function (name, value) {
|
|
@@ -1878,7 +1738,8 @@ var warnValidStyle = function () {};
|
|
|
1878
1738
|
}
|
|
1879
1739
|
|
|
1880
1740
|
warnedForInfinityValue = true;
|
|
1881
|
-
|
|
1741
|
+
|
|
1742
|
+
error('`Infinity` is an invalid value for the `%s` css style property.', name);
|
|
1882
1743
|
};
|
|
1883
1744
|
|
|
1884
1745
|
warnValidStyle = function (name, value) {
|
|
@@ -1964,47 +1825,52 @@ var ariaProperties = {
|
|
|
1964
1825
|
var warnedProperties = {};
|
|
1965
1826
|
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1966
1827
|
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
1967
|
-
var hasOwnProperty$
|
|
1828
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1968
1829
|
|
|
1969
1830
|
function validateProperty(tagName, name) {
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1831
|
+
{
|
|
1832
|
+
if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
|
|
1833
|
+
return true;
|
|
1834
|
+
}
|
|
1973
1835
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
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.
|
|
1978
1840
|
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
warnedProperties[name] = true;
|
|
1982
|
-
return true;
|
|
1983
|
-
} // 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);
|
|
1984
1843
|
|
|
1844
|
+
warnedProperties[name] = true;
|
|
1845
|
+
return true;
|
|
1846
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
1985
1847
|
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
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
|
+
}
|
|
1990
1855
|
}
|
|
1991
|
-
}
|
|
1992
1856
|
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
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.
|
|
1997
1861
|
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
1862
|
+
if (standardName == null) {
|
|
1863
|
+
warnedProperties[name] = true;
|
|
1864
|
+
return false;
|
|
1865
|
+
} // aria-* attributes should be lowercase; suggest the lowercase version.
|
|
2002
1866
|
|
|
2003
1867
|
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
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
|
+
}
|
|
2008
1874
|
}
|
|
2009
1875
|
}
|
|
2010
1876
|
|
|
@@ -2012,24 +1878,26 @@ function validateProperty(tagName, name) {
|
|
|
2012
1878
|
}
|
|
2013
1879
|
|
|
2014
1880
|
function warnInvalidARIAProps(type, props) {
|
|
2015
|
-
|
|
1881
|
+
{
|
|
1882
|
+
var invalidProps = [];
|
|
2016
1883
|
|
|
2017
|
-
|
|
2018
|
-
|
|
1884
|
+
for (var key in props) {
|
|
1885
|
+
var isValid = validateProperty(type, key);
|
|
2019
1886
|
|
|
2020
|
-
|
|
2021
|
-
|
|
1887
|
+
if (!isValid) {
|
|
1888
|
+
invalidProps.push(key);
|
|
1889
|
+
}
|
|
2022
1890
|
}
|
|
2023
|
-
}
|
|
2024
1891
|
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1892
|
+
var unknownPropString = invalidProps.map(function (prop) {
|
|
1893
|
+
return '`' + prop + '`';
|
|
1894
|
+
}).join(', ');
|
|
2028
1895
|
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
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
|
+
}
|
|
2033
1901
|
}
|
|
2034
1902
|
}
|
|
2035
1903
|
|
|
@@ -2043,48 +1911,28 @@ function validateProperties(type, props) {
|
|
|
2043
1911
|
|
|
2044
1912
|
var didWarnValueNull = false;
|
|
2045
1913
|
function validateProperties$1(type, props) {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
1914
|
+
{
|
|
1915
|
+
if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
2049
1918
|
|
|
2050
|
-
|
|
2051
|
-
|
|
1919
|
+
if (props != null && props.value === null && !didWarnValueNull) {
|
|
1920
|
+
didWarnValueNull = true;
|
|
2052
1921
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
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
|
+
}
|
|
2057
1927
|
}
|
|
2058
1928
|
}
|
|
2059
1929
|
}
|
|
2060
1930
|
|
|
2061
|
-
/**
|
|
2062
|
-
* Registers plugins so that they can extract and dispatch events.
|
|
2063
|
-
*
|
|
2064
|
-
* @see {EventPluginHub}
|
|
2065
|
-
*/
|
|
2066
|
-
|
|
2067
|
-
/**
|
|
2068
|
-
* Ordered list of injected plugins.
|
|
2069
|
-
*/
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
/**
|
|
2074
|
-
* Mapping from event name to dispatch config
|
|
2075
|
-
*/
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
1931
|
/**
|
|
2079
1932
|
* Mapping from registration name to plugin module
|
|
2080
1933
|
*/
|
|
2081
1934
|
|
|
2082
1935
|
var registrationNameModules = {};
|
|
2083
|
-
/**
|
|
2084
|
-
* Mapping from registration name to event name
|
|
2085
|
-
*/
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
1936
|
/**
|
|
2089
1937
|
* Mapping from lowercase registration names to the properly cased version,
|
|
2090
1938
|
* used to warn in the case of missing event handlers. Available
|
|
@@ -2092,29 +1940,7 @@ var registrationNameModules = {};
|
|
|
2092
1940
|
* @type {Object}
|
|
2093
1941
|
*/
|
|
2094
1942
|
|
|
2095
|
-
var possibleRegistrationNames =
|
|
2096
|
-
|
|
2097
|
-
/**
|
|
2098
|
-
* Injects an ordering of plugins (by plugin name). This allows the ordering
|
|
2099
|
-
* to be decoupled from injection of the actual plugins so that ordering is
|
|
2100
|
-
* always deterministic regardless of packaging, on-the-fly injection, etc.
|
|
2101
|
-
*
|
|
2102
|
-
* @param {array} InjectedEventPluginOrder
|
|
2103
|
-
* @internal
|
|
2104
|
-
* @see {EventPluginHub.injection.injectEventPluginOrder}
|
|
2105
|
-
*/
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
/**
|
|
2109
|
-
* Injects plugins to be used by `EventPluginHub`. The plugin names must be
|
|
2110
|
-
* in the ordering injected by `injectEventPluginOrder`.
|
|
2111
|
-
*
|
|
2112
|
-
* Plugins can be injected as part of page initialization or on-the-fly.
|
|
2113
|
-
*
|
|
2114
|
-
* @param {object} injectedNamesToPlugins Map from names to plugin modules.
|
|
2115
|
-
* @internal
|
|
2116
|
-
* @see {EventPluginHub.injection.injectEventPluginsByName}
|
|
2117
|
-
*/
|
|
1943
|
+
var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true
|
|
2118
1944
|
|
|
2119
1945
|
// When adding attributes to the HTML or SVG whitelist, be sure to
|
|
2120
1946
|
// also add them to this module to ensure casing and incorrect name
|
|
@@ -2623,7 +2449,8 @@ var validateProperty$1 = function () {};
|
|
|
2623
2449
|
var lowerCasedName = name.toLowerCase();
|
|
2624
2450
|
|
|
2625
2451
|
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
2626
|
-
|
|
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
|
+
|
|
2627
2454
|
warnedProperties$1[name] = true;
|
|
2628
2455
|
return true;
|
|
2629
2456
|
} // We can't rely on the event system being injected on the server.
|
|
@@ -2637,13 +2464,15 @@ var validateProperty$1 = function () {};
|
|
|
2637
2464
|
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
|
2638
2465
|
|
|
2639
2466
|
if (registrationName != null) {
|
|
2640
|
-
|
|
2467
|
+
error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
|
2468
|
+
|
|
2641
2469
|
warnedProperties$1[name] = true;
|
|
2642
2470
|
return true;
|
|
2643
2471
|
}
|
|
2644
2472
|
|
|
2645
2473
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
2646
|
-
|
|
2474
|
+
error('Unknown event handler property `%s`. It will be ignored.', name);
|
|
2475
|
+
|
|
2647
2476
|
warnedProperties$1[name] = true;
|
|
2648
2477
|
return true;
|
|
2649
2478
|
}
|
|
@@ -2652,7 +2481,7 @@ var validateProperty$1 = function () {};
|
|
|
2652
2481
|
// So we can't tell if the event name is correct for sure, but we can filter
|
|
2653
2482
|
// out known bad ones like `onclick`. We can't suggest a specific replacement though.
|
|
2654
2483
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
2655
|
-
|
|
2484
|
+
error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
|
2656
2485
|
}
|
|
2657
2486
|
|
|
2658
2487
|
warnedProperties$1[name] = true;
|
|
@@ -2665,25 +2494,29 @@ var validateProperty$1 = function () {};
|
|
|
2665
2494
|
}
|
|
2666
2495
|
|
|
2667
2496
|
if (lowerCasedName === 'innerhtml') {
|
|
2668
|
-
|
|
2497
|
+
error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
2498
|
+
|
|
2669
2499
|
warnedProperties$1[name] = true;
|
|
2670
2500
|
return true;
|
|
2671
2501
|
}
|
|
2672
2502
|
|
|
2673
2503
|
if (lowerCasedName === 'aria') {
|
|
2674
|
-
|
|
2504
|
+
error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
2505
|
+
|
|
2675
2506
|
warnedProperties$1[name] = true;
|
|
2676
2507
|
return true;
|
|
2677
2508
|
}
|
|
2678
2509
|
|
|
2679
2510
|
if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
|
2680
|
-
|
|
2511
|
+
error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
|
2512
|
+
|
|
2681
2513
|
warnedProperties$1[name] = true;
|
|
2682
2514
|
return true;
|
|
2683
2515
|
}
|
|
2684
2516
|
|
|
2685
2517
|
if (typeof value === 'number' && isNaN(value)) {
|
|
2686
|
-
|
|
2518
|
+
error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
|
2519
|
+
|
|
2687
2520
|
warnedProperties$1[name] = true;
|
|
2688
2521
|
return true;
|
|
2689
2522
|
}
|
|
@@ -2695,23 +2528,25 @@ var validateProperty$1 = function () {};
|
|
|
2695
2528
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
2696
2529
|
|
|
2697
2530
|
if (standardName !== name) {
|
|
2698
|
-
|
|
2531
|
+
error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
|
2532
|
+
|
|
2699
2533
|
warnedProperties$1[name] = true;
|
|
2700
2534
|
return true;
|
|
2701
2535
|
}
|
|
2702
2536
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
2703
2537
|
// Unknown attributes should have lowercase casing since that's how they
|
|
2704
2538
|
// will be cased anyway with server rendering.
|
|
2705
|
-
|
|
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
|
+
|
|
2706
2541
|
warnedProperties$1[name] = true;
|
|
2707
2542
|
return true;
|
|
2708
2543
|
}
|
|
2709
2544
|
|
|
2710
2545
|
if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
2711
2546
|
if (value) {
|
|
2712
|
-
|
|
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);
|
|
2713
2548
|
} else {
|
|
2714
|
-
|
|
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);
|
|
2715
2550
|
}
|
|
2716
2551
|
|
|
2717
2552
|
warnedProperties$1[name] = true;
|
|
@@ -2732,7 +2567,8 @@ var validateProperty$1 = function () {};
|
|
|
2732
2567
|
|
|
2733
2568
|
|
|
2734
2569
|
if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
2735
|
-
|
|
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
|
+
|
|
2736
2572
|
warnedProperties$1[name] = true;
|
|
2737
2573
|
return true;
|
|
2738
2574
|
}
|
|
@@ -2742,24 +2578,26 @@ var validateProperty$1 = function () {};
|
|
|
2742
2578
|
}
|
|
2743
2579
|
|
|
2744
2580
|
var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
|
2745
|
-
|
|
2581
|
+
{
|
|
2582
|
+
var unknownProps = [];
|
|
2746
2583
|
|
|
2747
|
-
|
|
2748
|
-
|
|
2584
|
+
for (var key in props) {
|
|
2585
|
+
var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
|
2749
2586
|
|
|
2750
|
-
|
|
2751
|
-
|
|
2587
|
+
if (!isValid) {
|
|
2588
|
+
unknownProps.push(key);
|
|
2589
|
+
}
|
|
2752
2590
|
}
|
|
2753
|
-
}
|
|
2754
2591
|
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2592
|
+
var unknownPropString = unknownProps.map(function (prop) {
|
|
2593
|
+
return '`' + prop + '`';
|
|
2594
|
+
}).join(', ');
|
|
2758
2595
|
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
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
|
+
}
|
|
2763
2601
|
}
|
|
2764
2602
|
};
|
|
2765
2603
|
|
|
@@ -2778,7 +2616,7 @@ var toArray = React.Children.toArray; // This is only used in DEV.
|
|
|
2778
2616
|
|
|
2779
2617
|
var currentDebugStacks = [];
|
|
2780
2618
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2781
|
-
var ReactDebugCurrentFrame;
|
|
2619
|
+
var ReactDebugCurrentFrame$4;
|
|
2782
2620
|
var prevGetCurrentStackImpl = null;
|
|
2783
2621
|
|
|
2784
2622
|
var getCurrentServerStackImpl = function () {
|
|
@@ -2800,7 +2638,7 @@ var popCurrentDebugStack = function () {};
|
|
|
2800
2638
|
var hasWarnedAboutUsingContextAsConsumer = false;
|
|
2801
2639
|
|
|
2802
2640
|
{
|
|
2803
|
-
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2641
|
+
ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2804
2642
|
|
|
2805
2643
|
validatePropertiesInDevelopment = function (type, props) {
|
|
2806
2644
|
validateProperties(type, props);
|
|
@@ -2824,8 +2662,8 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2824
2662
|
if (currentDebugStacks.length === 1) {
|
|
2825
2663
|
// We are entering a server renderer.
|
|
2826
2664
|
// Remember the previous (e.g. client) global stack implementation.
|
|
2827
|
-
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
|
2828
|
-
ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
|
2665
|
+
prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack;
|
|
2666
|
+
ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl;
|
|
2829
2667
|
}
|
|
2830
2668
|
};
|
|
2831
2669
|
|
|
@@ -2846,7 +2684,7 @@ var hasWarnedAboutUsingContextAsConsumer = false;
|
|
|
2846
2684
|
if (currentDebugStacks.length === 0) {
|
|
2847
2685
|
// We are exiting the server renderer.
|
|
2848
2686
|
// Restore the previous (e.g. client) global stack implementation.
|
|
2849
|
-
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
|
2687
|
+
ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl;
|
|
2850
2688
|
prevGetCurrentStackImpl = null;
|
|
2851
2689
|
}
|
|
2852
2690
|
};
|
|
@@ -2906,7 +2744,7 @@ function validateDangerousTag(tag) {
|
|
|
2906
2744
|
if (!validatedTagCache.hasOwnProperty(tag)) {
|
|
2907
2745
|
if (!VALID_TAG_REGEX.test(tag)) {
|
|
2908
2746
|
{
|
|
2909
|
-
throw Error("Invalid tag: " + tag);
|
|
2747
|
+
throw Error( "Invalid tag: " + tag );
|
|
2910
2748
|
}
|
|
2911
2749
|
}
|
|
2912
2750
|
|
|
@@ -2964,7 +2802,8 @@ function warnNoop(publicInstance, callerName) {
|
|
|
2964
2802
|
return;
|
|
2965
2803
|
}
|
|
2966
2804
|
|
|
2967
|
-
|
|
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
|
+
|
|
2968
2807
|
didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
|
2969
2808
|
}
|
|
2970
2809
|
}
|
|
@@ -3030,14 +2869,15 @@ function flattenOptionChildren(children) {
|
|
|
3030
2869
|
{
|
|
3031
2870
|
if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
|
3032
2871
|
didWarnInvalidOptionChildren = true;
|
|
3033
|
-
|
|
2872
|
+
|
|
2873
|
+
error('Only strings and numbers are supported as <option> children.');
|
|
3034
2874
|
}
|
|
3035
2875
|
}
|
|
3036
2876
|
});
|
|
3037
2877
|
return content;
|
|
3038
2878
|
}
|
|
3039
2879
|
|
|
3040
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2880
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
3041
2881
|
var STYLE = 'style';
|
|
3042
2882
|
var RESERVED_PROPS = {
|
|
3043
2883
|
children: null,
|
|
@@ -3050,11 +2890,7 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
3050
2890
|
var ret = '<' + tagVerbatim;
|
|
3051
2891
|
|
|
3052
2892
|
for (var propKey in props) {
|
|
3053
|
-
if (!hasOwnProperty.call(props, propKey)) {
|
|
3054
|
-
continue;
|
|
3055
|
-
}
|
|
3056
|
-
|
|
3057
|
-
if (enableFlareAPI && propKey === 'listeners') {
|
|
2893
|
+
if (!hasOwnProperty$2.call(props, propKey)) {
|
|
3058
2894
|
continue;
|
|
3059
2895
|
}
|
|
3060
2896
|
|
|
@@ -3100,7 +2936,7 @@ function validateRenderResult(child, type) {
|
|
|
3100
2936
|
if (child === undefined) {
|
|
3101
2937
|
{
|
|
3102
2938
|
{
|
|
3103
|
-
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." );
|
|
3104
2940
|
}
|
|
3105
2941
|
}
|
|
3106
2942
|
}
|
|
@@ -3163,7 +2999,8 @@ function resolve(child, context, threadID) {
|
|
|
3163
2999
|
var componentName = getComponentName(Component) || 'Unknown';
|
|
3164
3000
|
|
|
3165
3001
|
if (!didWarnAboutUninitializedState[componentName]) {
|
|
3166
|
-
|
|
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
|
+
|
|
3167
3004
|
didWarnAboutUninitializedState[componentName] = true;
|
|
3168
3005
|
}
|
|
3169
3006
|
}
|
|
@@ -3176,7 +3013,8 @@ function resolve(child, context, threadID) {
|
|
|
3176
3013
|
var _componentName = getComponentName(Component) || 'Unknown';
|
|
3177
3014
|
|
|
3178
3015
|
if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
|
3179
|
-
|
|
3016
|
+
error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
|
3017
|
+
|
|
3180
3018
|
didWarnAboutUndefinedDerivedState[_componentName] = true;
|
|
3181
3019
|
}
|
|
3182
3020
|
}
|
|
@@ -3192,7 +3030,8 @@ function resolve(child, context, threadID) {
|
|
|
3192
3030
|
var _componentName2 = getComponentName(Component) || 'Unknown';
|
|
3193
3031
|
|
|
3194
3032
|
if (!didWarnAboutBadClass[_componentName2]) {
|
|
3195
|
-
|
|
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
|
+
|
|
3196
3035
|
didWarnAboutBadClass[_componentName2] = true;
|
|
3197
3036
|
}
|
|
3198
3037
|
}
|
|
@@ -3213,7 +3052,8 @@ function resolve(child, context, threadID) {
|
|
|
3213
3052
|
var _componentName3 = getComponentName(Component) || 'Unknown';
|
|
3214
3053
|
|
|
3215
3054
|
if (!didWarnAboutModulePatternComponent[_componentName3]) {
|
|
3216
|
-
|
|
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
|
+
|
|
3217
3057
|
didWarnAboutModulePatternComponent[_componentName3] = true;
|
|
3218
3058
|
}
|
|
3219
3059
|
}
|
|
@@ -3231,12 +3071,13 @@ function resolve(child, context, threadID) {
|
|
|
3231
3071
|
if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
|
3232
3072
|
if (typeof inst.componentWillMount === 'function') {
|
|
3233
3073
|
{
|
|
3234
|
-
if (
|
|
3074
|
+
if ( inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
|
3235
3075
|
var _componentName4 = getComponentName(Component) || 'Unknown';
|
|
3236
3076
|
|
|
3237
3077
|
if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
|
|
3238
|
-
|
|
3078
|
+
warn( // keep this warning in sync with ReactStrictModeWarning.js
|
|
3239
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
|
+
|
|
3240
3081
|
didWarnAboutDeprecatedWillMount[_componentName4] = true;
|
|
3241
3082
|
}
|
|
3242
3083
|
}
|
|
@@ -3302,15 +3143,7 @@ function resolve(child, context, threadID) {
|
|
|
3302
3143
|
validateRenderResult(child, Component);
|
|
3303
3144
|
var childContext;
|
|
3304
3145
|
|
|
3305
|
-
|
|
3306
|
-
{
|
|
3307
|
-
var childContextTypes = Component.childContextTypes;
|
|
3308
|
-
|
|
3309
|
-
if (childContextTypes !== undefined) {
|
|
3310
|
-
warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
|
|
3311
|
-
}
|
|
3312
|
-
}
|
|
3313
|
-
} else {
|
|
3146
|
+
{
|
|
3314
3147
|
if (typeof inst.getChildContext === 'function') {
|
|
3315
3148
|
var _childContextTypes = Component.childContextTypes;
|
|
3316
3149
|
|
|
@@ -3320,12 +3153,14 @@ function resolve(child, context, threadID) {
|
|
|
3320
3153
|
for (var contextKey in childContext) {
|
|
3321
3154
|
if (!(contextKey in _childContextTypes)) {
|
|
3322
3155
|
{
|
|
3323
|
-
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." );
|
|
3324
3157
|
}
|
|
3325
3158
|
}
|
|
3326
3159
|
}
|
|
3327
3160
|
} else {
|
|
3328
|
-
|
|
3161
|
+
{
|
|
3162
|
+
error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
|
3163
|
+
}
|
|
3329
3164
|
}
|
|
3330
3165
|
}
|
|
3331
3166
|
|
|
@@ -3423,7 +3258,9 @@ function () {
|
|
|
3423
3258
|
var index = this.contextIndex;
|
|
3424
3259
|
|
|
3425
3260
|
{
|
|
3426
|
-
|
|
3261
|
+
if (index < 0 || provider !== this.contextProviderStack[index]) {
|
|
3262
|
+
error('Unexpected pop.');
|
|
3263
|
+
}
|
|
3427
3264
|
}
|
|
3428
3265
|
|
|
3429
3266
|
var context = this.contextStack[index];
|
|
@@ -3504,7 +3341,7 @@ function () {
|
|
|
3504
3341
|
|
|
3505
3342
|
if (!fallbackFrame) {
|
|
3506
3343
|
{
|
|
3507
|
-
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));
|
|
3508
3345
|
}
|
|
3509
3346
|
}
|
|
3510
3347
|
|
|
@@ -3525,7 +3362,7 @@ function () {
|
|
|
3525
3362
|
var child = frame.children[frame.childIndex++];
|
|
3526
3363
|
var outBuffer = '';
|
|
3527
3364
|
|
|
3528
|
-
{
|
|
3365
|
+
if (true) {
|
|
3529
3366
|
pushCurrentDebugStack(this.stack); // We're starting work on this frame, so reset its inner stack.
|
|
3530
3367
|
|
|
3531
3368
|
frame.debugElementStack.length = 0;
|
|
@@ -3538,15 +3375,15 @@ function () {
|
|
|
3538
3375
|
if (enableSuspenseServerRenderer) {
|
|
3539
3376
|
if (!(this.suspenseDepth > 0)) {
|
|
3540
3377
|
{
|
|
3541
|
-
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));
|
|
3542
3379
|
}
|
|
3543
3380
|
}
|
|
3544
3381
|
|
|
3545
3382
|
suspended = true;
|
|
3546
3383
|
} else {
|
|
3547
|
-
{
|
|
3384
|
+
if (!false) {
|
|
3548
3385
|
{
|
|
3549
|
-
throw Error("ReactDOMServer does not yet support Suspense.");
|
|
3386
|
+
throw Error(true ? "ReactDOMServer does not yet support Suspense." : formatProdErrorMessage(294));
|
|
3550
3387
|
}
|
|
3551
3388
|
}
|
|
3552
3389
|
}
|
|
@@ -3554,7 +3391,7 @@ function () {
|
|
|
3554
3391
|
throw err;
|
|
3555
3392
|
}
|
|
3556
3393
|
} finally {
|
|
3557
|
-
{
|
|
3394
|
+
if (true) {
|
|
3558
3395
|
popCurrentDebugStack();
|
|
3559
3396
|
}
|
|
3560
3397
|
}
|
|
@@ -3608,14 +3445,14 @@ function () {
|
|
|
3608
3445
|
|
|
3609
3446
|
if (!($$typeof !== REACT_PORTAL_TYPE)) {
|
|
3610
3447
|
{
|
|
3611
|
-
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." );
|
|
3612
3449
|
}
|
|
3613
3450
|
} // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
|
|
3614
3451
|
|
|
3615
3452
|
|
|
3616
3453
|
{
|
|
3617
3454
|
{
|
|
3618
|
-
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." );
|
|
3619
3456
|
}
|
|
3620
3457
|
}
|
|
3621
3458
|
}
|
|
@@ -3674,72 +3511,14 @@ function () {
|
|
|
3674
3511
|
|
|
3675
3512
|
case REACT_SUSPENSE_TYPE:
|
|
3676
3513
|
{
|
|
3677
|
-
|
|
3678
|
-
var fallback = nextChild.props.fallback;
|
|
3679
|
-
|
|
3680
|
-
if (fallback === undefined) {
|
|
3681
|
-
// If there is no fallback, then this just behaves as a fragment.
|
|
3682
|
-
var _nextChildren3 = toArray(nextChild.props.children);
|
|
3683
|
-
|
|
3684
|
-
var _frame3 = {
|
|
3685
|
-
type: null,
|
|
3686
|
-
domNamespace: parentNamespace,
|
|
3687
|
-
children: _nextChildren3,
|
|
3688
|
-
childIndex: 0,
|
|
3689
|
-
context: context,
|
|
3690
|
-
footer: ''
|
|
3691
|
-
};
|
|
3692
|
-
|
|
3693
|
-
{
|
|
3694
|
-
_frame3.debugElementStack = [];
|
|
3695
|
-
}
|
|
3696
|
-
|
|
3697
|
-
this.stack.push(_frame3);
|
|
3698
|
-
return '';
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
var fallbackChildren = toArray(fallback);
|
|
3702
|
-
|
|
3703
|
-
var _nextChildren2 = toArray(nextChild.props.children);
|
|
3704
|
-
|
|
3705
|
-
var fallbackFrame = {
|
|
3706
|
-
type: null,
|
|
3707
|
-
domNamespace: parentNamespace,
|
|
3708
|
-
children: fallbackChildren,
|
|
3709
|
-
childIndex: 0,
|
|
3710
|
-
context: context,
|
|
3711
|
-
footer: '<!--/$-->'
|
|
3712
|
-
};
|
|
3713
|
-
var _frame2 = {
|
|
3714
|
-
fallbackFrame: fallbackFrame,
|
|
3715
|
-
type: REACT_SUSPENSE_TYPE,
|
|
3716
|
-
domNamespace: parentNamespace,
|
|
3717
|
-
children: _nextChildren2,
|
|
3718
|
-
childIndex: 0,
|
|
3719
|
-
context: context,
|
|
3720
|
-
footer: '<!--/$-->'
|
|
3721
|
-
};
|
|
3722
|
-
|
|
3723
|
-
{
|
|
3724
|
-
_frame2.debugElementStack = [];
|
|
3725
|
-
fallbackFrame.debugElementStack = [];
|
|
3726
|
-
}
|
|
3727
|
-
|
|
3728
|
-
this.stack.push(_frame2);
|
|
3729
|
-
this.suspenseDepth++;
|
|
3730
|
-
return '<!--$-->';
|
|
3731
|
-
} else {
|
|
3514
|
+
{
|
|
3732
3515
|
{
|
|
3733
3516
|
{
|
|
3734
|
-
throw Error("ReactDOMServer does not yet support Suspense.");
|
|
3517
|
+
throw Error( "ReactDOMServer does not yet support Suspense." );
|
|
3735
3518
|
}
|
|
3736
3519
|
}
|
|
3737
3520
|
}
|
|
3738
3521
|
}
|
|
3739
|
-
// eslint-disable-next-line-no-fallthrough
|
|
3740
|
-
|
|
3741
|
-
default:
|
|
3742
|
-
break;
|
|
3743
3522
|
}
|
|
3744
3523
|
|
|
3745
3524
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
@@ -3838,7 +3617,8 @@ function () {
|
|
|
3838
3617
|
if (reactContext !== reactContext.Consumer) {
|
|
3839
3618
|
if (!hasWarnedAboutUsingContextAsConsumer) {
|
|
3840
3619
|
hasWarnedAboutUsingContextAsConsumer = true;
|
|
3841
|
-
|
|
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?');
|
|
3842
3622
|
}
|
|
3843
3623
|
}
|
|
3844
3624
|
} else {
|
|
@@ -3873,34 +3653,10 @@ function () {
|
|
|
3873
3653
|
|
|
3874
3654
|
case REACT_FUNDAMENTAL_TYPE:
|
|
3875
3655
|
{
|
|
3876
|
-
if (enableFundamentalAPI) {
|
|
3877
|
-
var fundamentalImpl = elementType.impl;
|
|
3878
|
-
var open = fundamentalImpl.getServerSideString(null, nextElement.props);
|
|
3879
|
-
var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
|
|
3880
|
-
var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
|
|
3881
|
-
|
|
3882
|
-
var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
|
|
3883
|
-
|
|
3884
|
-
var _frame8 = {
|
|
3885
|
-
type: null,
|
|
3886
|
-
domNamespace: parentNamespace,
|
|
3887
|
-
children: _nextChildren8,
|
|
3888
|
-
childIndex: 0,
|
|
3889
|
-
context: context,
|
|
3890
|
-
footer: close
|
|
3891
|
-
};
|
|
3892
|
-
|
|
3893
|
-
{
|
|
3894
|
-
_frame8.debugElementStack = [];
|
|
3895
|
-
}
|
|
3896
|
-
|
|
3897
|
-
this.stack.push(_frame8);
|
|
3898
|
-
return open;
|
|
3899
|
-
}
|
|
3900
3656
|
|
|
3901
3657
|
{
|
|
3902
3658
|
{
|
|
3903
|
-
throw Error("ReactDOMServer does not yet support the fundamental API.");
|
|
3659
|
+
throw Error( "ReactDOMServer does not yet support the fundamental API." );
|
|
3904
3660
|
}
|
|
3905
3661
|
}
|
|
3906
3662
|
}
|
|
@@ -3945,7 +3701,7 @@ function () {
|
|
|
3945
3701
|
default:
|
|
3946
3702
|
{
|
|
3947
3703
|
{
|
|
3948
|
-
throw Error("ReactDOMServer does not yet support lazy-loaded components.");
|
|
3704
|
+
throw Error( "ReactDOMServer does not yet support lazy-loaded components." );
|
|
3949
3705
|
}
|
|
3950
3706
|
}
|
|
3951
3707
|
|
|
@@ -3955,29 +3711,10 @@ function () {
|
|
|
3955
3711
|
|
|
3956
3712
|
case REACT_SCOPE_TYPE:
|
|
3957
3713
|
{
|
|
3958
|
-
if (enableScopeAPI) {
|
|
3959
|
-
var _nextChildren10 = toArray(nextChild.props.children);
|
|
3960
|
-
|
|
3961
|
-
var _frame10 = {
|
|
3962
|
-
type: null,
|
|
3963
|
-
domNamespace: parentNamespace,
|
|
3964
|
-
children: _nextChildren10,
|
|
3965
|
-
childIndex: 0,
|
|
3966
|
-
context: context,
|
|
3967
|
-
footer: ''
|
|
3968
|
-
};
|
|
3969
|
-
|
|
3970
|
-
{
|
|
3971
|
-
_frame10.debugElementStack = [];
|
|
3972
|
-
}
|
|
3973
|
-
|
|
3974
|
-
this.stack.push(_frame10);
|
|
3975
|
-
return '';
|
|
3976
|
-
}
|
|
3977
3714
|
|
|
3978
3715
|
{
|
|
3979
3716
|
{
|
|
3980
|
-
throw Error("ReactDOMServer does not yet support scope components.");
|
|
3717
|
+
throw Error( "ReactDOMServer does not yet support scope components." );
|
|
3981
3718
|
}
|
|
3982
3719
|
}
|
|
3983
3720
|
}
|
|
@@ -4002,7 +3739,7 @@ function () {
|
|
|
4002
3739
|
|
|
4003
3740
|
{
|
|
4004
3741
|
{
|
|
4005
|
-
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 );
|
|
4006
3743
|
}
|
|
4007
3744
|
}
|
|
4008
3745
|
}
|
|
@@ -4020,7 +3757,9 @@ function () {
|
|
|
4020
3757
|
if (namespace === Namespaces.html) {
|
|
4021
3758
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
4022
3759
|
// allow <SVG> or <mATH>.
|
|
4023
|
-
|
|
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
|
+
}
|
|
4024
3763
|
}
|
|
4025
3764
|
}
|
|
4026
3765
|
|
|
@@ -4032,12 +3771,14 @@ function () {
|
|
|
4032
3771
|
ReactControlledValuePropTypes.checkPropTypes('input', props);
|
|
4033
3772
|
|
|
4034
3773
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
|
4035
|
-
|
|
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
|
+
|
|
4036
3776
|
didWarnDefaultChecked = true;
|
|
4037
3777
|
}
|
|
4038
3778
|
|
|
4039
3779
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
|
4040
|
-
|
|
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
|
+
|
|
4041
3782
|
didWarnDefaultInputValue = true;
|
|
4042
3783
|
}
|
|
4043
3784
|
}
|
|
@@ -4055,7 +3796,8 @@ function () {
|
|
|
4055
3796
|
ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
|
4056
3797
|
|
|
4057
3798
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
|
4058
|
-
|
|
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
|
+
|
|
4059
3801
|
didWarnDefaultTextareaValue = true;
|
|
4060
3802
|
}
|
|
4061
3803
|
}
|
|
@@ -4069,19 +3811,19 @@ function () {
|
|
|
4069
3811
|
|
|
4070
3812
|
if (textareaChildren != null) {
|
|
4071
3813
|
{
|
|
4072
|
-
|
|
3814
|
+
error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
4073
3815
|
}
|
|
4074
3816
|
|
|
4075
3817
|
if (!(defaultValue == null)) {
|
|
4076
3818
|
{
|
|
4077
|
-
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." );
|
|
4078
3820
|
}
|
|
4079
3821
|
}
|
|
4080
3822
|
|
|
4081
3823
|
if (Array.isArray(textareaChildren)) {
|
|
4082
3824
|
if (!(textareaChildren.length <= 1)) {
|
|
4083
3825
|
{
|
|
4084
|
-
throw Error("<textarea> can only have at most one child.");
|
|
3826
|
+
throw Error( "<textarea> can only have at most one child." );
|
|
4085
3827
|
}
|
|
4086
3828
|
}
|
|
4087
3829
|
|
|
@@ -4116,14 +3858,15 @@ function () {
|
|
|
4116
3858
|
var isArray = Array.isArray(props[propName]);
|
|
4117
3859
|
|
|
4118
3860
|
if (props.multiple && !isArray) {
|
|
4119
|
-
|
|
3861
|
+
error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
|
4120
3862
|
} else if (!props.multiple && isArray) {
|
|
4121
|
-
|
|
3863
|
+
error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
|
4122
3864
|
}
|
|
4123
3865
|
}
|
|
4124
3866
|
|
|
4125
3867
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
|
4126
|
-
|
|
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
|
+
|
|
4127
3870
|
didWarnDefaultSelectValue = true;
|
|
4128
3871
|
}
|
|
4129
3872
|
}
|
|
@@ -4191,7 +3934,7 @@ function () {
|
|
|
4191
3934
|
if (innerMarkup != null) {
|
|
4192
3935
|
children = [];
|
|
4193
3936
|
|
|
4194
|
-
if (newlineEatingTags
|
|
3937
|
+
if (newlineEatingTags.hasOwnProperty(tag) && innerMarkup.charAt(0) === '\n') {
|
|
4195
3938
|
// text/html ignores the first character in these tags if it's a newline
|
|
4196
3939
|
// Prefer to break application/xml over text/html (for now) by adding
|
|
4197
3940
|
// a newline specifically to get eaten by the parser. (Alternately for
|
|
@@ -4267,7 +4010,7 @@ function renderToStaticMarkup(element) {
|
|
|
4267
4010
|
function renderToNodeStream() {
|
|
4268
4011
|
{
|
|
4269
4012
|
{
|
|
4270
|
-
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." );
|
|
4271
4014
|
}
|
|
4272
4015
|
}
|
|
4273
4016
|
}
|
|
@@ -4275,13 +4018,13 @@ function renderToNodeStream() {
|
|
|
4275
4018
|
function renderToStaticNodeStream() {
|
|
4276
4019
|
{
|
|
4277
4020
|
{
|
|
4278
|
-
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." );
|
|
4279
4022
|
}
|
|
4280
4023
|
}
|
|
4281
4024
|
} // Note: when changing this, also consider https://github.com/facebook/react/issues/11526
|
|
4282
4025
|
|
|
4283
4026
|
|
|
4284
|
-
var
|
|
4027
|
+
var ReactDOMServer = {
|
|
4285
4028
|
renderToString: renderToString,
|
|
4286
4029
|
renderToStaticMarkup: renderToStaticMarkup,
|
|
4287
4030
|
renderToNodeStream: renderToNodeStream,
|
|
@@ -4289,12 +4032,6 @@ var ReactDOMServerBrowser = {
|
|
|
4289
4032
|
version: ReactVersion
|
|
4290
4033
|
};
|
|
4291
4034
|
|
|
4292
|
-
var ReactDOMServerBrowser$1 = Object.freeze({
|
|
4293
|
-
default: ReactDOMServerBrowser
|
|
4294
|
-
});
|
|
4295
|
-
|
|
4296
|
-
var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || ReactDOMServerBrowser$1;
|
|
4297
|
-
|
|
4298
4035
|
// TODO: decide on the top-level export form.
|
|
4299
4036
|
// This is hacky but makes it work with both Rollup and Jest
|
|
4300
4037
|
|