react-dom 16.4.0-alpha.7926752 → 16.5.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/README.md +1 -1
- package/cjs/react-dom-server.browser.development.js +611 -263
- package/cjs/react-dom-server.browser.production.min.js +35 -33
- package/cjs/react-dom-server.node.development.js +611 -263
- package/cjs/react-dom-server.node.production.min.js +37 -35
- package/cjs/react-dom-test-utils.development.js +394 -241
- package/cjs/react-dom-test-utils.production.min.js +25 -26
- package/cjs/react-dom-unstable-native-dependencies.development.js +247 -129
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +28 -28
- package/cjs/react-dom.development.js +12644 -11597
- package/cjs/react-dom.production.min.js +225 -245
- package/cjs/react-dom.profiling.min.js +245 -0
- package/package.json +5 -4
- package/profiling.js +38 -0
- package/umd/react-dom-server.browser.development.js +594 -537
- package/umd/react-dom-server.browser.production.min.js +29 -28
- package/umd/react-dom-test-utils.development.js +329 -358
- package/umd/react-dom-test-utils.production.min.js +21 -22
- package/umd/react-dom-unstable-native-dependencies.development.js +183 -214
- package/umd/react-dom-unstable-native-dependencies.production.min.js +23 -23
- package/umd/react-dom.development.js +12566 -11974
- package/umd/react-dom.production.min.js +184 -205
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.5.0
|
|
2
2
|
* react-dom-server.browser.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -15,27 +15,178 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
(function() {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
var invariant = require('fbjs/lib/invariant');
|
|
19
18
|
var _assign = require('object-assign');
|
|
20
19
|
var React = require('react');
|
|
21
|
-
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
22
|
-
var emptyObject = require('fbjs/lib/emptyObject');
|
|
23
|
-
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
|
|
24
|
-
var memoizeStringOnly = require('fbjs/lib/memoizeStringOnly');
|
|
25
|
-
var warning = require('fbjs/lib/warning');
|
|
26
20
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
27
|
-
var camelizeStyleName = require('fbjs/lib/camelizeStyleName');
|
|
28
21
|
|
|
29
22
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
23
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
24
|
+
*
|
|
25
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
26
|
+
* to provide information about what broke and what you were
|
|
27
|
+
* expecting.
|
|
28
|
+
*
|
|
29
|
+
* The invariant message will be stripped in production, but the invariant
|
|
30
|
+
* will remain to ensure logic does not differ in production.
|
|
34
31
|
*/
|
|
35
32
|
|
|
33
|
+
var validateFormat = function () {};
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
validateFormat = function (format) {
|
|
37
|
+
if (format === undefined) {
|
|
38
|
+
throw new Error('invariant requires an error message argument');
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
|
44
|
+
validateFormat(format);
|
|
45
|
+
|
|
46
|
+
if (!condition) {
|
|
47
|
+
var error = void 0;
|
|
48
|
+
if (format === undefined) {
|
|
49
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
50
|
+
} else {
|
|
51
|
+
var args = [a, b, c, d, e, f];
|
|
52
|
+
var argIndex = 0;
|
|
53
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
54
|
+
return args[argIndex++];
|
|
55
|
+
}));
|
|
56
|
+
error.name = 'Invariant Violation';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Relying on the `invariant()` implementation lets us
|
|
65
|
+
// preserve the format and params in the www builds.
|
|
66
|
+
|
|
36
67
|
// TODO: this is special because it gets imported during build.
|
|
37
68
|
|
|
38
|
-
var ReactVersion = '16.
|
|
69
|
+
var ReactVersion = '16.5.0';
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
73
|
+
* This can be used to log issues in development environments in critical
|
|
74
|
+
* paths. Removing the logging code for production environments will keep the
|
|
75
|
+
* same logic and follow the same code paths.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
var warningWithoutStack = function () {};
|
|
79
|
+
|
|
80
|
+
{
|
|
81
|
+
warningWithoutStack = function (condition, format) {
|
|
82
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
83
|
+
args[_key - 2] = arguments[_key];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (format === undefined) {
|
|
87
|
+
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
88
|
+
}
|
|
89
|
+
if (condition) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (typeof console !== 'undefined') {
|
|
93
|
+
var _console;
|
|
94
|
+
|
|
95
|
+
var stringArgs = args.map(function (item) {
|
|
96
|
+
return '' + item;
|
|
97
|
+
});
|
|
98
|
+
(_console = console).error.apply(_console, ['Warning: ' + format].concat(stringArgs));
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
// --- Welcome to debugging React ---
|
|
102
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
103
|
+
// to find the callsite that caused this warning to fire.
|
|
104
|
+
var argIndex = 0;
|
|
105
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
106
|
+
return args[argIndex++];
|
|
107
|
+
});
|
|
108
|
+
throw new Error(message);
|
|
109
|
+
} catch (x) {}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var warningWithoutStack$1 = warningWithoutStack;
|
|
114
|
+
|
|
115
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
116
|
+
// nor polyfill, then a plain number is used for performance.
|
|
117
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
121
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
122
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
123
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
124
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
125
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
126
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
127
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
128
|
+
var REACT_PLACEHOLDER_TYPE = hasSymbol ? Symbol.for('react.placeholder') : 0xead1;
|
|
129
|
+
|
|
130
|
+
var Resolved = 1;
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
function refineResolvedThenable(thenable) {
|
|
136
|
+
return thenable._reactStatus === Resolved ? thenable._reactResult : null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function getComponentName(type) {
|
|
140
|
+
if (type == null) {
|
|
141
|
+
// Host root, text node or just invalid type.
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
{
|
|
145
|
+
if (typeof type.tag === 'number') {
|
|
146
|
+
warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (typeof type === 'function') {
|
|
150
|
+
return type.displayName || type.name || null;
|
|
151
|
+
}
|
|
152
|
+
if (typeof type === 'string') {
|
|
153
|
+
return type;
|
|
154
|
+
}
|
|
155
|
+
switch (type) {
|
|
156
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
157
|
+
return 'AsyncMode';
|
|
158
|
+
case REACT_FRAGMENT_TYPE:
|
|
159
|
+
return 'Fragment';
|
|
160
|
+
case REACT_PORTAL_TYPE:
|
|
161
|
+
return 'Portal';
|
|
162
|
+
case REACT_PROFILER_TYPE:
|
|
163
|
+
return 'Profiler';
|
|
164
|
+
case REACT_STRICT_MODE_TYPE:
|
|
165
|
+
return 'StrictMode';
|
|
166
|
+
case REACT_PLACEHOLDER_TYPE:
|
|
167
|
+
return 'Placeholder';
|
|
168
|
+
}
|
|
169
|
+
if (typeof type === 'object') {
|
|
170
|
+
switch (type.$$typeof) {
|
|
171
|
+
case REACT_CONTEXT_TYPE:
|
|
172
|
+
return 'Context.Consumer';
|
|
173
|
+
case REACT_PROVIDER_TYPE:
|
|
174
|
+
return 'Context.Provider';
|
|
175
|
+
case REACT_FORWARD_REF_TYPE:
|
|
176
|
+
var renderFn = type.render;
|
|
177
|
+
var functionName = renderFn.displayName || renderFn.name || '';
|
|
178
|
+
return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
|
|
179
|
+
}
|
|
180
|
+
if (typeof type.then === 'function') {
|
|
181
|
+
var thenable = type;
|
|
182
|
+
var resolvedThenable = refineResolvedThenable(thenable);
|
|
183
|
+
if (resolvedThenable) {
|
|
184
|
+
return getComponentName(resolvedThenable);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
39
190
|
|
|
40
191
|
/**
|
|
41
192
|
* Forked from fbjs/warning:
|
|
@@ -76,7 +227,7 @@ var lowPriorityWarning = function () {};
|
|
|
76
227
|
|
|
77
228
|
lowPriorityWarning = function (condition, format) {
|
|
78
229
|
if (format === undefined) {
|
|
79
|
-
throw new Error('`
|
|
230
|
+
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
80
231
|
}
|
|
81
232
|
if (!condition) {
|
|
82
233
|
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
@@ -90,28 +241,72 @@ var lowPriorityWarning = function () {};
|
|
|
90
241
|
|
|
91
242
|
var lowPriorityWarning$1 = lowPriorityWarning;
|
|
92
243
|
|
|
93
|
-
var
|
|
94
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
95
|
-
};
|
|
244
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
96
245
|
|
|
97
|
-
|
|
246
|
+
/**
|
|
247
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
248
|
+
* This can be used to log issues in development environments in critical
|
|
249
|
+
* paths. Removing the logging code for production environments will keep the
|
|
250
|
+
* same logic and follow the same code paths.
|
|
251
|
+
*/
|
|
98
252
|
|
|
99
|
-
var
|
|
100
|
-
var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
|
253
|
+
var warning = warningWithoutStack$1;
|
|
101
254
|
|
|
102
|
-
|
|
255
|
+
{
|
|
256
|
+
warning = function (condition, format) {
|
|
257
|
+
if (condition) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
261
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
262
|
+
// eslint-disable-next-line react-internal/warning-and-invariant-args
|
|
103
263
|
|
|
264
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
265
|
+
args[_key - 2] = arguments[_key];
|
|
266
|
+
}
|
|
104
267
|
|
|
268
|
+
warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
|
269
|
+
};
|
|
270
|
+
}
|
|
105
271
|
|
|
106
|
-
|
|
272
|
+
var warning$1 = warning;
|
|
107
273
|
|
|
108
|
-
|
|
274
|
+
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
|
275
|
+
|
|
276
|
+
var describeComponentFrame = function (name, source, ownerName) {
|
|
277
|
+
var sourceInfo = '';
|
|
278
|
+
if (source) {
|
|
279
|
+
var path = source.fileName;
|
|
280
|
+
var fileName = path.replace(BEFORE_SLASH_RE, '');
|
|
281
|
+
{
|
|
282
|
+
// In DEV, include code for a common special case:
|
|
283
|
+
// prefer "folder/index.js" instead of just "index.js".
|
|
284
|
+
if (/^index\./.test(fileName)) {
|
|
285
|
+
var match = path.match(BEFORE_SLASH_RE);
|
|
286
|
+
if (match) {
|
|
287
|
+
var pathBeforeSlash = match[1];
|
|
288
|
+
if (pathBeforeSlash) {
|
|
289
|
+
var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
|
290
|
+
fileName = folderName + '/' + fileName;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
|
296
|
+
} else if (ownerName) {
|
|
297
|
+
sourceInfo = ' (created by ' + ownerName + ')';
|
|
298
|
+
}
|
|
299
|
+
return '\n in ' + (name || 'Unknown') + sourceInfo;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// Exports ReactDOM.createRoot
|
|
109
303
|
|
|
110
|
-
// Experimental persistent mode (Fabric):
|
|
111
304
|
|
|
112
305
|
// Experimental error-boundary API that can recover from errors within a single
|
|
113
306
|
// render phase
|
|
114
307
|
|
|
308
|
+
// Suspense
|
|
309
|
+
|
|
115
310
|
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
116
311
|
|
|
117
312
|
|
|
@@ -128,21 +323,19 @@ var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
|
|
128
323
|
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
129
324
|
var warnAboutDeprecatedLifecycles = false;
|
|
130
325
|
|
|
131
|
-
//
|
|
326
|
+
// Warn about legacy context API
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
// Track which interactions trigger each commit.
|
|
132
333
|
|
|
133
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
134
|
-
// nor polyfill, then a plain number is used for performance.
|
|
135
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
|
|
136
334
|
|
|
335
|
+
// Only used in www builds.
|
|
336
|
+
var enableSuspenseServerRenderer = false;
|
|
137
337
|
|
|
138
|
-
|
|
139
|
-
var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9;
|
|
140
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca;
|
|
141
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
|
142
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol['for']('react.strict_mode') : 0xeacc;
|
|
143
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd;
|
|
144
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace;
|
|
145
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf;
|
|
338
|
+
// Only used in www builds.
|
|
146
339
|
|
|
147
340
|
// A reserved attribute.
|
|
148
341
|
// It is handled by React separately and shouldn't be written to the DOM.
|
|
@@ -186,14 +379,15 @@ var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u
|
|
|
186
379
|
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
|
187
380
|
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
188
381
|
|
|
382
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
189
383
|
var illegalAttributeNameCache = {};
|
|
190
384
|
var validatedAttributeNameCache = {};
|
|
191
385
|
|
|
192
386
|
function isAttributeNameSafe(attributeName) {
|
|
193
|
-
if (
|
|
387
|
+
if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) {
|
|
194
388
|
return true;
|
|
195
389
|
}
|
|
196
|
-
if (
|
|
390
|
+
if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) {
|
|
197
391
|
return false;
|
|
198
392
|
}
|
|
199
393
|
if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
|
@@ -202,7 +396,7 @@ function isAttributeNameSafe(attributeName) {
|
|
|
202
396
|
}
|
|
203
397
|
illegalAttributeNameCache[attributeName] = true;
|
|
204
398
|
{
|
|
205
|
-
warning(false, 'Invalid attribute name: `%s`', attributeName);
|
|
399
|
+
warning$1(false, 'Invalid attribute name: `%s`', attributeName);
|
|
206
400
|
}
|
|
207
401
|
return false;
|
|
208
402
|
}
|
|
@@ -254,6 +448,9 @@ function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)
|
|
|
254
448
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
|
255
449
|
return true;
|
|
256
450
|
}
|
|
451
|
+
if (isCustomComponentTag) {
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
257
454
|
if (propertyInfo !== null) {
|
|
258
455
|
switch (propertyInfo.type) {
|
|
259
456
|
case BOOLEAN:
|
|
@@ -296,15 +493,20 @@ var properties = {};
|
|
|
296
493
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
297
494
|
name, // attributeName
|
|
298
495
|
null);
|
|
299
|
-
}
|
|
496
|
+
} // attributeNamespace
|
|
497
|
+
);
|
|
300
498
|
|
|
301
499
|
// A few React string attributes have a different name.
|
|
302
500
|
// This is a mapping from React prop names to the attribute names.
|
|
303
|
-
|
|
501
|
+
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
|
502
|
+
var name = _ref[0],
|
|
503
|
+
attributeName = _ref[1];
|
|
504
|
+
|
|
304
505
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
305
506
|
attributeName, // attributeName
|
|
306
507
|
null);
|
|
307
|
-
}
|
|
508
|
+
} // attributeNamespace
|
|
509
|
+
);
|
|
308
510
|
|
|
309
511
|
// These are "enumerated" HTML attributes that accept "true" and "false".
|
|
310
512
|
// In React, we let users pass `true` and `false` even though technically
|
|
@@ -313,17 +515,19 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
313
515
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
314
516
|
name.toLowerCase(), // attributeName
|
|
315
517
|
null);
|
|
316
|
-
}
|
|
518
|
+
} // attributeNamespace
|
|
519
|
+
);
|
|
317
520
|
|
|
318
521
|
// These are "enumerated" SVG attributes that accept "true" and "false".
|
|
319
522
|
// In React, we let users pass `true` and `false` even though technically
|
|
320
523
|
// these aren't boolean attributes (they are coerced to strings).
|
|
321
524
|
// Since these are SVG attributes, their attribute names are case-sensitive.
|
|
322
|
-
['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(function (name) {
|
|
525
|
+
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
|
|
323
526
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
324
527
|
name, // attributeName
|
|
325
528
|
null);
|
|
326
|
-
}
|
|
529
|
+
} // attributeNamespace
|
|
530
|
+
);
|
|
327
531
|
|
|
328
532
|
// These are HTML boolean attributes.
|
|
329
533
|
['allowFullScreen', 'async',
|
|
@@ -335,7 +539,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
335
539
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
|
|
336
540
|
name.toLowerCase(), // attributeName
|
|
337
541
|
null);
|
|
338
|
-
}
|
|
542
|
+
} // attributeNamespace
|
|
543
|
+
);
|
|
339
544
|
|
|
340
545
|
// These are the few React props that we set as DOM properties
|
|
341
546
|
// rather than attributes. These are all booleans.
|
|
@@ -344,31 +549,35 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
344
549
|
// disabled with `removeAttribute`. We have special logic for handling this.
|
|
345
550
|
'multiple', 'muted', 'selected'].forEach(function (name) {
|
|
346
551
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
347
|
-
name
|
|
552
|
+
name, // attributeName
|
|
348
553
|
null);
|
|
349
|
-
}
|
|
554
|
+
} // attributeNamespace
|
|
555
|
+
);
|
|
350
556
|
|
|
351
557
|
// These are HTML attributes that are "overloaded booleans": they behave like
|
|
352
558
|
// booleans, but can also accept a string value.
|
|
353
559
|
['capture', 'download'].forEach(function (name) {
|
|
354
560
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
355
|
-
name
|
|
561
|
+
name, // attributeName
|
|
356
562
|
null);
|
|
357
|
-
}
|
|
563
|
+
} // attributeNamespace
|
|
564
|
+
);
|
|
358
565
|
|
|
359
566
|
// These are HTML attributes that must be positive numbers.
|
|
360
567
|
['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
|
361
568
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
362
|
-
name
|
|
569
|
+
name, // attributeName
|
|
363
570
|
null);
|
|
364
|
-
}
|
|
571
|
+
} // attributeNamespace
|
|
572
|
+
);
|
|
365
573
|
|
|
366
574
|
// These are HTML attributes that must be numbers.
|
|
367
575
|
['rowSpan', 'start'].forEach(function (name) {
|
|
368
576
|
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
|
|
369
577
|
name.toLowerCase(), // attributeName
|
|
370
578
|
null);
|
|
371
|
-
}
|
|
579
|
+
} // attributeNamespace
|
|
580
|
+
);
|
|
372
581
|
|
|
373
582
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
374
583
|
var capitalize = function (token) {
|
|
@@ -384,7 +593,8 @@ var capitalize = function (token) {
|
|
|
384
593
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
385
594
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
386
595
|
attributeName, null);
|
|
387
|
-
}
|
|
596
|
+
} // attributeNamespace
|
|
597
|
+
);
|
|
388
598
|
|
|
389
599
|
// String SVG attributes with the xlink namespace.
|
|
390
600
|
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
|
@@ -540,9 +750,10 @@ function createMarkupForProperty(name, value) {
|
|
|
540
750
|
} else {
|
|
541
751
|
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
|
542
752
|
}
|
|
543
|
-
} else {
|
|
753
|
+
} else if (isAttributeNameSafe(name)) {
|
|
544
754
|
return name + '=' + quoteAttributeValueForBrowser(value);
|
|
545
755
|
}
|
|
756
|
+
return '';
|
|
546
757
|
}
|
|
547
758
|
|
|
548
759
|
/**
|
|
@@ -594,11 +805,15 @@ function getChildNamespace(parentNamespace, type) {
|
|
|
594
805
|
return parentNamespace;
|
|
595
806
|
}
|
|
596
807
|
|
|
808
|
+
var ReactDebugCurrentFrame$1 = null;
|
|
809
|
+
|
|
597
810
|
var ReactControlledValuePropTypes = {
|
|
598
811
|
checkPropTypes: null
|
|
599
812
|
};
|
|
600
813
|
|
|
601
814
|
{
|
|
815
|
+
ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
816
|
+
|
|
602
817
|
var hasReadOnlyValue = {
|
|
603
818
|
button: true,
|
|
604
819
|
checkbox: true,
|
|
@@ -611,13 +826,13 @@ var ReactControlledValuePropTypes = {
|
|
|
611
826
|
|
|
612
827
|
var propTypes = {
|
|
613
828
|
value: function (props, propName, componentName) {
|
|
614
|
-
if (
|
|
829
|
+
if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
|
615
830
|
return null;
|
|
616
831
|
}
|
|
617
832
|
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`.');
|
|
618
833
|
},
|
|
619
834
|
checked: function (props, propName, componentName) {
|
|
620
|
-
if (
|
|
835
|
+
if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
|
621
836
|
return null;
|
|
622
837
|
}
|
|
623
838
|
return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
|
@@ -628,8 +843,8 @@ var ReactControlledValuePropTypes = {
|
|
|
628
843
|
* Provide a linked `value` attribute for controlled forms. You should not use
|
|
629
844
|
* this outside of the ReactDOM controlled form components.
|
|
630
845
|
*/
|
|
631
|
-
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props
|
|
632
|
-
checkPropTypes(propTypes, props, 'prop', tagName,
|
|
846
|
+
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
|
847
|
+
checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
|
|
633
848
|
};
|
|
634
849
|
}
|
|
635
850
|
|
|
@@ -652,6 +867,7 @@ var omittedCloseTags = {
|
|
|
652
867
|
source: true,
|
|
653
868
|
track: true,
|
|
654
869
|
wbr: true
|
|
870
|
+
// NOTE: menuitem's close tag should be omitted, but that causes problems.
|
|
655
871
|
};
|
|
656
872
|
|
|
657
873
|
// For HTML, certain tags cannot have children. This has the same purpose as
|
|
@@ -661,24 +877,31 @@ var voidElementTags = _assign({
|
|
|
661
877
|
menuitem: true
|
|
662
878
|
}, omittedCloseTags);
|
|
663
879
|
|
|
880
|
+
// TODO: We can remove this if we add invariantWithStack()
|
|
881
|
+
// or add stack by default to invariants where possible.
|
|
664
882
|
var HTML = '__html';
|
|
665
883
|
|
|
666
|
-
|
|
884
|
+
var ReactDebugCurrentFrame$2 = null;
|
|
885
|
+
{
|
|
886
|
+
ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function assertValidProps(tag, props) {
|
|
667
890
|
if (!props) {
|
|
668
891
|
return;
|
|
669
892
|
}
|
|
670
893
|
// Note the use of `==` which checks for null or undefined.
|
|
671
894
|
if (voidElementTags[tag]) {
|
|
672
|
-
!(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag,
|
|
895
|
+
!(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, ReactDebugCurrentFrame$2.getStackAddendum()) : void 0;
|
|
673
896
|
}
|
|
674
897
|
if (props.dangerouslySetInnerHTML != null) {
|
|
675
898
|
!(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
|
|
676
899
|
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
|
|
677
900
|
}
|
|
678
901
|
{
|
|
679
|
-
|
|
902
|
+
!(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, '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.') : void 0;
|
|
680
903
|
}
|
|
681
|
-
!(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s',
|
|
904
|
+
!(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', ReactDebugCurrentFrame$2.getStackAddendum()) : void 0;
|
|
682
905
|
}
|
|
683
906
|
|
|
684
907
|
/**
|
|
@@ -700,6 +923,7 @@ var isUnitlessNumber = {
|
|
|
700
923
|
flexShrink: true,
|
|
701
924
|
flexNegative: true,
|
|
702
925
|
flexOrder: true,
|
|
926
|
+
gridArea: true,
|
|
703
927
|
gridRow: true,
|
|
704
928
|
gridRowEnd: true,
|
|
705
929
|
gridRowSpan: true,
|
|
@@ -786,6 +1010,26 @@ function dangerousStyleValue(name, value, isCustomProperty) {
|
|
|
786
1010
|
return ('' + value).trim();
|
|
787
1011
|
}
|
|
788
1012
|
|
|
1013
|
+
var uppercasePattern = /([A-Z])/g;
|
|
1014
|
+
var msPattern = /^ms-/;
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Hyphenates a camelcased CSS property name, for example:
|
|
1018
|
+
*
|
|
1019
|
+
* > hyphenateStyleName('backgroundColor')
|
|
1020
|
+
* < "background-color"
|
|
1021
|
+
* > hyphenateStyleName('MozTransition')
|
|
1022
|
+
* < "-moz-transition"
|
|
1023
|
+
* > hyphenateStyleName('msTransition')
|
|
1024
|
+
* < "-ms-transition"
|
|
1025
|
+
*
|
|
1026
|
+
* As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
|
|
1027
|
+
* is converted to `-ms-`.
|
|
1028
|
+
*/
|
|
1029
|
+
function hyphenateStyleName(name) {
|
|
1030
|
+
return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
|
|
1031
|
+
}
|
|
1032
|
+
|
|
789
1033
|
function isCustomComponent(tagName, props) {
|
|
790
1034
|
if (tagName.indexOf('-') === -1) {
|
|
791
1035
|
return typeof props.is === 'string';
|
|
@@ -809,11 +1053,13 @@ function isCustomComponent(tagName, props) {
|
|
|
809
1053
|
}
|
|
810
1054
|
}
|
|
811
1055
|
|
|
812
|
-
var warnValidStyle =
|
|
1056
|
+
var warnValidStyle = function () {};
|
|
813
1057
|
|
|
814
1058
|
{
|
|
815
1059
|
// 'msTransform' is correct, but the other prefixes should be capitalized
|
|
816
1060
|
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
1061
|
+
var msPattern$1 = /^-ms-/;
|
|
1062
|
+
var hyphenPattern = /-(.)/g;
|
|
817
1063
|
|
|
818
1064
|
// style values shouldn't contain a semicolon
|
|
819
1065
|
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
@@ -823,65 +1069,75 @@ var warnValidStyle = emptyFunction;
|
|
|
823
1069
|
var warnedForNaNValue = false;
|
|
824
1070
|
var warnedForInfinityValue = false;
|
|
825
1071
|
|
|
826
|
-
var
|
|
1072
|
+
var camelize = function (string) {
|
|
1073
|
+
return string.replace(hyphenPattern, function (_, character) {
|
|
1074
|
+
return character.toUpperCase();
|
|
1075
|
+
});
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
var warnHyphenatedStyleName = function (name) {
|
|
827
1079
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
828
1080
|
return;
|
|
829
1081
|
}
|
|
830
1082
|
|
|
831
1083
|
warnedStyleNames[name] = true;
|
|
832
|
-
warning(false, 'Unsupported style property %s. Did you mean %s
|
|
1084
|
+
warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
|
|
1085
|
+
// As Andi Smith suggests
|
|
1086
|
+
// (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
1087
|
+
// is converted to lowercase `ms`.
|
|
1088
|
+
camelize(name.replace(msPattern$1, 'ms-')));
|
|
833
1089
|
};
|
|
834
1090
|
|
|
835
|
-
var warnBadVendoredStyleName = function (name
|
|
1091
|
+
var warnBadVendoredStyleName = function (name) {
|
|
836
1092
|
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
837
1093
|
return;
|
|
838
1094
|
}
|
|
839
1095
|
|
|
840
1096
|
warnedStyleNames[name] = true;
|
|
841
|
-
warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s
|
|
1097
|
+
warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
|
842
1098
|
};
|
|
843
1099
|
|
|
844
|
-
var warnStyleValueWithSemicolon = function (name, value
|
|
1100
|
+
var warnStyleValueWithSemicolon = function (name, value) {
|
|
845
1101
|
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
846
1102
|
return;
|
|
847
1103
|
}
|
|
848
1104
|
|
|
849
1105
|
warnedStyleValues[value] = true;
|
|
850
|
-
warning(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead
|
|
1106
|
+
warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
|
851
1107
|
};
|
|
852
1108
|
|
|
853
|
-
var warnStyleValueIsNaN = function (name, value
|
|
1109
|
+
var warnStyleValueIsNaN = function (name, value) {
|
|
854
1110
|
if (warnedForNaNValue) {
|
|
855
1111
|
return;
|
|
856
1112
|
}
|
|
857
1113
|
|
|
858
1114
|
warnedForNaNValue = true;
|
|
859
|
-
warning(false, '`NaN` is an invalid value for the `%s` css style property
|
|
1115
|
+
warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
|
|
860
1116
|
};
|
|
861
1117
|
|
|
862
|
-
var warnStyleValueIsInfinity = function (name, value
|
|
1118
|
+
var warnStyleValueIsInfinity = function (name, value) {
|
|
863
1119
|
if (warnedForInfinityValue) {
|
|
864
1120
|
return;
|
|
865
1121
|
}
|
|
866
1122
|
|
|
867
1123
|
warnedForInfinityValue = true;
|
|
868
|
-
warning(false, '`Infinity` is an invalid value for the `%s` css style property
|
|
1124
|
+
warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
|
|
869
1125
|
};
|
|
870
1126
|
|
|
871
|
-
warnValidStyle = function (name, value
|
|
1127
|
+
warnValidStyle = function (name, value) {
|
|
872
1128
|
if (name.indexOf('-') > -1) {
|
|
873
|
-
warnHyphenatedStyleName(name
|
|
1129
|
+
warnHyphenatedStyleName(name);
|
|
874
1130
|
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
875
|
-
warnBadVendoredStyleName(name
|
|
1131
|
+
warnBadVendoredStyleName(name);
|
|
876
1132
|
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
877
|
-
warnStyleValueWithSemicolon(name, value
|
|
1133
|
+
warnStyleValueWithSemicolon(name, value);
|
|
878
1134
|
}
|
|
879
1135
|
|
|
880
1136
|
if (typeof value === 'number') {
|
|
881
1137
|
if (isNaN(value)) {
|
|
882
|
-
warnStyleValueIsNaN(name, value
|
|
1138
|
+
warnStyleValueIsNaN(name, value);
|
|
883
1139
|
} else if (!isFinite(value)) {
|
|
884
|
-
warnStyleValueIsInfinity(name, value
|
|
1140
|
+
warnStyleValueIsInfinity(name, value);
|
|
885
1141
|
}
|
|
886
1142
|
}
|
|
887
1143
|
};
|
|
@@ -948,15 +1204,10 @@ var warnedProperties = {};
|
|
|
948
1204
|
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
949
1205
|
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
950
1206
|
|
|
951
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
952
|
-
|
|
953
|
-
function getStackAddendum$1() {
|
|
954
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
955
|
-
return stack != null ? stack : '';
|
|
956
|
-
}
|
|
1207
|
+
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
957
1208
|
|
|
958
1209
|
function validateProperty(tagName, name) {
|
|
959
|
-
if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
|
|
1210
|
+
if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
|
|
960
1211
|
return true;
|
|
961
1212
|
}
|
|
962
1213
|
|
|
@@ -967,13 +1218,13 @@ function validateProperty(tagName, name) {
|
|
|
967
1218
|
// If this is an aria-* attribute, but is not listed in the known DOM
|
|
968
1219
|
// DOM properties, then it is an invalid aria-* attribute.
|
|
969
1220
|
if (correctName == null) {
|
|
970
|
-
warning(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase
|
|
1221
|
+
warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
|
971
1222
|
warnedProperties[name] = true;
|
|
972
1223
|
return true;
|
|
973
1224
|
}
|
|
974
1225
|
// aria-* attributes should be lowercase; suggest the lowercase version.
|
|
975
1226
|
if (name !== correctName) {
|
|
976
|
-
warning(false, 'Invalid ARIA attribute `%s`. Did you mean `%s
|
|
1227
|
+
warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
|
977
1228
|
warnedProperties[name] = true;
|
|
978
1229
|
return true;
|
|
979
1230
|
}
|
|
@@ -991,7 +1242,7 @@ function validateProperty(tagName, name) {
|
|
|
991
1242
|
}
|
|
992
1243
|
// aria-* attributes should be lowercase; suggest the lowercase version.
|
|
993
1244
|
if (name !== standardName) {
|
|
994
|
-
warning(false, 'Unknown ARIA attribute `%s`. Did you mean `%s
|
|
1245
|
+
warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
|
995
1246
|
warnedProperties[name] = true;
|
|
996
1247
|
return true;
|
|
997
1248
|
}
|
|
@@ -1015,9 +1266,9 @@ function warnInvalidARIAProps(type, props) {
|
|
|
1015
1266
|
}).join(', ');
|
|
1016
1267
|
|
|
1017
1268
|
if (invalidProps.length === 1) {
|
|
1018
|
-
warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop
|
|
1269
|
+
warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1019
1270
|
} else if (invalidProps.length > 1) {
|
|
1020
|
-
warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop
|
|
1271
|
+
warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
|
1021
1272
|
}
|
|
1022
1273
|
}
|
|
1023
1274
|
|
|
@@ -1030,11 +1281,6 @@ function validateProperties(type, props) {
|
|
|
1030
1281
|
|
|
1031
1282
|
var didWarnValueNull = false;
|
|
1032
1283
|
|
|
1033
|
-
function getStackAddendum$2() {
|
|
1034
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
1035
|
-
return stack != null ? stack : '';
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
1284
|
function validateProperties$1(type, props) {
|
|
1039
1285
|
if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
|
1040
1286
|
return;
|
|
@@ -1043,9 +1289,9 @@ function validateProperties$1(type, props) {
|
|
|
1043
1289
|
if (props != null && props.value === null && !didWarnValueNull) {
|
|
1044
1290
|
didWarnValueNull = true;
|
|
1045
1291
|
if (type === 'select' && props.multiple) {
|
|
1046
|
-
warning(false, '`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
|
|
1292
|
+
warning$1(false, '`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);
|
|
1047
1293
|
} else {
|
|
1048
|
-
warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components
|
|
1294
|
+
warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
|
|
1049
1295
|
}
|
|
1050
1296
|
}
|
|
1051
1297
|
}
|
|
@@ -1135,7 +1381,7 @@ var possibleStandardNames = {
|
|
|
1135
1381
|
checked: 'checked',
|
|
1136
1382
|
children: 'children',
|
|
1137
1383
|
cite: 'cite',
|
|
1138
|
-
|
|
1384
|
+
class: 'className',
|
|
1139
1385
|
classid: 'classID',
|
|
1140
1386
|
classname: 'className',
|
|
1141
1387
|
cols: 'cols',
|
|
@@ -1150,7 +1396,7 @@ var possibleStandardNames = {
|
|
|
1150
1396
|
dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
|
1151
1397
|
data: 'data',
|
|
1152
1398
|
datetime: 'dateTime',
|
|
1153
|
-
|
|
1399
|
+
default: 'default',
|
|
1154
1400
|
defaultchecked: 'defaultChecked',
|
|
1155
1401
|
defaultvalue: 'defaultValue',
|
|
1156
1402
|
defer: 'defer',
|
|
@@ -1159,7 +1405,7 @@ var possibleStandardNames = {
|
|
|
1159
1405
|
download: 'download',
|
|
1160
1406
|
draggable: 'draggable',
|
|
1161
1407
|
enctype: 'encType',
|
|
1162
|
-
|
|
1408
|
+
for: 'htmlFor',
|
|
1163
1409
|
form: 'form',
|
|
1164
1410
|
formmethod: 'formMethod',
|
|
1165
1411
|
formaction: 'formAction',
|
|
@@ -1377,7 +1623,7 @@ var possibleStandardNames = {
|
|
|
1377
1623
|
imagerendering: 'imageRendering',
|
|
1378
1624
|
'image-rendering': 'imageRendering',
|
|
1379
1625
|
in2: 'in2',
|
|
1380
|
-
|
|
1626
|
+
in: 'in',
|
|
1381
1627
|
inlist: 'inlist',
|
|
1382
1628
|
intercept: 'intercept',
|
|
1383
1629
|
k1: 'k1',
|
|
@@ -1517,7 +1763,7 @@ var possibleStandardNames = {
|
|
|
1517
1763
|
'text-rendering': 'textRendering',
|
|
1518
1764
|
to: 'to',
|
|
1519
1765
|
transform: 'transform',
|
|
1520
|
-
|
|
1766
|
+
typeof: 'typeof',
|
|
1521
1767
|
u1: 'u1',
|
|
1522
1768
|
u2: 'u2',
|
|
1523
1769
|
underlineposition: 'underlinePosition',
|
|
@@ -1596,11 +1842,6 @@ var possibleStandardNames = {
|
|
|
1596
1842
|
zoomandpan: 'zoomAndPan'
|
|
1597
1843
|
};
|
|
1598
1844
|
|
|
1599
|
-
function getStackAddendum$3() {
|
|
1600
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
1601
|
-
return stack != null ? stack : '';
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
1845
|
var validateProperty$1 = function () {};
|
|
1605
1846
|
|
|
1606
1847
|
{
|
|
@@ -1618,7 +1859,7 @@ var validateProperty$1 = function () {};
|
|
|
1618
1859
|
|
|
1619
1860
|
var lowerCasedName = name.toLowerCase();
|
|
1620
1861
|
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
1621
|
-
warning(false, '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.');
|
|
1862
|
+
warning$1(false, '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.');
|
|
1622
1863
|
warnedProperties$1[name] = true;
|
|
1623
1864
|
return true;
|
|
1624
1865
|
}
|
|
@@ -1630,12 +1871,12 @@ var validateProperty$1 = function () {};
|
|
|
1630
1871
|
}
|
|
1631
1872
|
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
|
1632
1873
|
if (registrationName != null) {
|
|
1633
|
-
warning(false, 'Invalid event handler property `%s`. Did you mean `%s
|
|
1874
|
+
warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
|
1634
1875
|
warnedProperties$1[name] = true;
|
|
1635
1876
|
return true;
|
|
1636
1877
|
}
|
|
1637
1878
|
if (EVENT_NAME_REGEX.test(name)) {
|
|
1638
|
-
warning(false, 'Unknown event handler property `%s`. It will be ignored
|
|
1879
|
+
warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
|
|
1639
1880
|
warnedProperties$1[name] = true;
|
|
1640
1881
|
return true;
|
|
1641
1882
|
}
|
|
@@ -1644,7 +1885,7 @@ var validateProperty$1 = function () {};
|
|
|
1644
1885
|
// So we can't tell if the event name is correct for sure, but we can filter
|
|
1645
1886
|
// out known bad ones like `onclick`. We can't suggest a specific replacement though.
|
|
1646
1887
|
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
1647
|
-
warning(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick
|
|
1888
|
+
warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
|
1648
1889
|
}
|
|
1649
1890
|
warnedProperties$1[name] = true;
|
|
1650
1891
|
return true;
|
|
@@ -1656,25 +1897,25 @@ var validateProperty$1 = function () {};
|
|
|
1656
1897
|
}
|
|
1657
1898
|
|
|
1658
1899
|
if (lowerCasedName === 'innerhtml') {
|
|
1659
|
-
warning(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
1900
|
+
warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
1660
1901
|
warnedProperties$1[name] = true;
|
|
1661
1902
|
return true;
|
|
1662
1903
|
}
|
|
1663
1904
|
|
|
1664
1905
|
if (lowerCasedName === 'aria') {
|
|
1665
|
-
warning(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
1906
|
+
warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
1666
1907
|
warnedProperties$1[name] = true;
|
|
1667
1908
|
return true;
|
|
1668
1909
|
}
|
|
1669
1910
|
|
|
1670
1911
|
if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
|
1671
|
-
warning(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string
|
|
1912
|
+
warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
|
1672
1913
|
warnedProperties$1[name] = true;
|
|
1673
1914
|
return true;
|
|
1674
1915
|
}
|
|
1675
1916
|
|
|
1676
1917
|
if (typeof value === 'number' && isNaN(value)) {
|
|
1677
|
-
warning(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string
|
|
1918
|
+
warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
|
1678
1919
|
warnedProperties$1[name] = true;
|
|
1679
1920
|
return true;
|
|
1680
1921
|
}
|
|
@@ -1686,23 +1927,23 @@ var validateProperty$1 = function () {};
|
|
|
1686
1927
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
1687
1928
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
1688
1929
|
if (standardName !== name) {
|
|
1689
|
-
warning(false, 'Invalid DOM property `%s`. Did you mean `%s
|
|
1930
|
+
warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
|
1690
1931
|
warnedProperties$1[name] = true;
|
|
1691
1932
|
return true;
|
|
1692
1933
|
}
|
|
1693
1934
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
1694
1935
|
// Unknown attributes should have lowercase casing since that's how they
|
|
1695
1936
|
// will be cased anyway with server rendering.
|
|
1696
|
-
warning(false, '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
|
|
1937
|
+
warning$1(false, '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);
|
|
1697
1938
|
warnedProperties$1[name] = true;
|
|
1698
1939
|
return true;
|
|
1699
1940
|
}
|
|
1700
1941
|
|
|
1701
1942
|
if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
|
1702
1943
|
if (value) {
|
|
1703
|
-
warning(false, '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()}
|
|
1944
|
+
warning$1(false, '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);
|
|
1704
1945
|
} else {
|
|
1705
|
-
warning(false, '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
|
|
1946
|
+
warning$1(false, '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);
|
|
1706
1947
|
}
|
|
1707
1948
|
warnedProperties$1[name] = true;
|
|
1708
1949
|
return true;
|
|
@@ -1720,6 +1961,13 @@ var validateProperty$1 = function () {};
|
|
|
1720
1961
|
return false;
|
|
1721
1962
|
}
|
|
1722
1963
|
|
|
1964
|
+
// Warn when passing the strings 'false' or 'true' into a boolean prop
|
|
1965
|
+
if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
|
1966
|
+
warning$1(false, '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);
|
|
1967
|
+
warnedProperties$1[name] = true;
|
|
1968
|
+
return true;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1723
1971
|
return true;
|
|
1724
1972
|
};
|
|
1725
1973
|
}
|
|
@@ -1737,9 +1985,9 @@ var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
|
|
1737
1985
|
return '`' + prop + '`';
|
|
1738
1986
|
}).join(', ');
|
|
1739
1987
|
if (unknownProps.length === 1) {
|
|
1740
|
-
warning(false, '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
|
|
1988
|
+
warning$1(false, '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);
|
|
1741
1989
|
} else if (unknownProps.length > 1) {
|
|
1742
|
-
warning(false, '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
|
|
1990
|
+
warning$1(false, '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);
|
|
1743
1991
|
}
|
|
1744
1992
|
};
|
|
1745
1993
|
|
|
@@ -1756,18 +2004,29 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
1756
2004
|
|
|
1757
2005
|
var toArray = React.Children.toArray;
|
|
1758
2006
|
|
|
1759
|
-
|
|
1760
|
-
|
|
2007
|
+
// This is only used in DEV.
|
|
2008
|
+
// Each entry is `this.stack` from a currently executing renderer instance.
|
|
2009
|
+
// (There may be more than one because ReactDOMServer is reentrant).
|
|
2010
|
+
// Each stack is an array of frames which may contain nested stacks of elements.
|
|
2011
|
+
var currentDebugStacks = [];
|
|
1761
2012
|
|
|
1762
|
-
var
|
|
1763
|
-
var
|
|
2013
|
+
var ReactDebugCurrentFrame = void 0;
|
|
2014
|
+
var prevGetCurrentStackImpl = null;
|
|
2015
|
+
var getCurrentServerStackImpl = function () {
|
|
2016
|
+
return '';
|
|
2017
|
+
};
|
|
2018
|
+
var describeStackFrame = function (element) {
|
|
2019
|
+
return '';
|
|
2020
|
+
};
|
|
1764
2021
|
|
|
1765
2022
|
var validatePropertiesInDevelopment = function (type, props) {};
|
|
1766
|
-
var
|
|
2023
|
+
var pushCurrentDebugStack = function (stack) {};
|
|
1767
2024
|
var pushElementToDebugStack = function (element) {};
|
|
1768
|
-
var
|
|
2025
|
+
var popCurrentDebugStack = function () {};
|
|
1769
2026
|
|
|
1770
2027
|
{
|
|
2028
|
+
ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2029
|
+
|
|
1771
2030
|
validatePropertiesInDevelopment = function (type, props) {
|
|
1772
2031
|
validateProperties(type, props);
|
|
1773
2032
|
validateProperties$1(type, props);
|
|
@@ -1782,34 +2041,55 @@ var resetCurrentDebugStack = function () {};
|
|
|
1782
2041
|
return describeComponentFrame(name, source, ownerName);
|
|
1783
2042
|
};
|
|
1784
2043
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
2044
|
+
pushCurrentDebugStack = function (stack) {
|
|
2045
|
+
currentDebugStacks.push(stack);
|
|
2046
|
+
|
|
2047
|
+
if (currentDebugStacks.length === 1) {
|
|
2048
|
+
// We are entering a server renderer.
|
|
2049
|
+
// Remember the previous (e.g. client) global stack implementation.
|
|
2050
|
+
prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
|
2051
|
+
ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
|
2052
|
+
}
|
|
1794
2053
|
};
|
|
2054
|
+
|
|
1795
2055
|
pushElementToDebugStack = function (element) {
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
2056
|
+
// For the innermost executing ReactDOMServer call,
|
|
2057
|
+
var stack = currentDebugStacks[currentDebugStacks.length - 1];
|
|
2058
|
+
// Take the innermost executing frame (e.g. <Foo>),
|
|
2059
|
+
var frame = stack[stack.length - 1];
|
|
2060
|
+
// and record that it has one more element associated with it.
|
|
2061
|
+
frame.debugElementStack.push(element);
|
|
2062
|
+
// We only need this because we tail-optimize single-element
|
|
2063
|
+
// children and directly handle them in an inner loop instead of
|
|
2064
|
+
// creating separate frames for them.
|
|
1799
2065
|
};
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
2066
|
+
|
|
2067
|
+
popCurrentDebugStack = function () {
|
|
2068
|
+
currentDebugStacks.pop();
|
|
2069
|
+
|
|
2070
|
+
if (currentDebugStacks.length === 0) {
|
|
2071
|
+
// We are exiting the server renderer.
|
|
2072
|
+
// Restore the previous (e.g. client) global stack implementation.
|
|
2073
|
+
ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
|
2074
|
+
prevGetCurrentStackImpl = null;
|
|
2075
|
+
}
|
|
1804
2076
|
};
|
|
1805
|
-
|
|
1806
|
-
|
|
2077
|
+
|
|
2078
|
+
getCurrentServerStackImpl = function () {
|
|
2079
|
+
if (currentDebugStacks.length === 0) {
|
|
2080
|
+
// Nothing is currently rendering.
|
|
1807
2081
|
return '';
|
|
1808
2082
|
}
|
|
2083
|
+
// ReactDOMServer is reentrant so there may be multiple calls at the same time.
|
|
2084
|
+
// Take the frames from the innermost call which is the last in the array.
|
|
2085
|
+
var frames = currentDebugStacks[currentDebugStacks.length - 1];
|
|
1809
2086
|
var stack = '';
|
|
1810
|
-
|
|
1811
|
-
for (var i =
|
|
1812
|
-
var frame =
|
|
2087
|
+
// Go through every frame in the stack from the innermost one.
|
|
2088
|
+
for (var i = frames.length - 1; i >= 0; i--) {
|
|
2089
|
+
var frame = frames[i];
|
|
2090
|
+
// Every frame might have more than one debug element stack entry associated with it.
|
|
2091
|
+
// This is because single-child nesting doesn't create materialized frames.
|
|
2092
|
+
// Instead it would push them through `pushElementToDebugStack()`.
|
|
1813
2093
|
var _debugElementStack = frame.debugElementStack;
|
|
1814
2094
|
for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) {
|
|
1815
2095
|
stack += describeStackFrame(_debugElementStack[ii]);
|
|
@@ -1836,10 +2116,6 @@ var newlineEatingTags = {
|
|
|
1836
2116
|
textarea: true
|
|
1837
2117
|
};
|
|
1838
2118
|
|
|
1839
|
-
function getComponentName(type) {
|
|
1840
|
-
return typeof type === 'string' ? type : typeof type === 'function' ? type.displayName || type.name : null;
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
2119
|
// We accept any tag to be rendered but since this gets injected into arbitrary
|
|
1844
2120
|
// HTML, we want to make sure that it's a safe tag.
|
|
1845
2121
|
// http://www.w3.org/TR/REC-xml/#NT-Name
|
|
@@ -1852,9 +2128,15 @@ function validateDangerousTag(tag) {
|
|
|
1852
2128
|
}
|
|
1853
2129
|
}
|
|
1854
2130
|
|
|
1855
|
-
var
|
|
1856
|
-
|
|
1857
|
-
|
|
2131
|
+
var styleNameCache = {};
|
|
2132
|
+
var processStyleName = function (styleName) {
|
|
2133
|
+
if (styleNameCache.hasOwnProperty(styleName)) {
|
|
2134
|
+
return styleNameCache[styleName];
|
|
2135
|
+
}
|
|
2136
|
+
var result = hyphenateStyleName(styleName);
|
|
2137
|
+
styleNameCache[styleName] = result;
|
|
2138
|
+
return result;
|
|
2139
|
+
};
|
|
1858
2140
|
|
|
1859
2141
|
function createMarkupForStyles(styles) {
|
|
1860
2142
|
var serialized = '';
|
|
@@ -1867,7 +2149,7 @@ function createMarkupForStyles(styles) {
|
|
|
1867
2149
|
var styleValue = styles[styleName];
|
|
1868
2150
|
{
|
|
1869
2151
|
if (!isCustomProperty) {
|
|
1870
|
-
warnValidStyle$1(styleName, styleValue
|
|
2152
|
+
warnValidStyle$1(styleName, styleValue);
|
|
1871
2153
|
}
|
|
1872
2154
|
}
|
|
1873
2155
|
if (styleValue != null) {
|
|
@@ -1889,7 +2171,7 @@ function warnNoop(publicInstance, callerName) {
|
|
|
1889
2171
|
return;
|
|
1890
2172
|
}
|
|
1891
2173
|
|
|
1892
|
-
|
|
2174
|
+
warningWithoutStack$1(false, '%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);
|
|
1893
2175
|
didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
|
1894
2176
|
}
|
|
1895
2177
|
}
|
|
@@ -1930,6 +2212,9 @@ function flattenTopLevelChildren(children) {
|
|
|
1930
2212
|
}
|
|
1931
2213
|
|
|
1932
2214
|
function flattenOptionChildren(children) {
|
|
2215
|
+
if (children === undefined || children === null) {
|
|
2216
|
+
return children;
|
|
2217
|
+
}
|
|
1933
2218
|
var content = '';
|
|
1934
2219
|
// Flatten children and warn if they aren't strings or numbers;
|
|
1935
2220
|
// invalid types are ignored.
|
|
@@ -1937,20 +2222,22 @@ function flattenOptionChildren(children) {
|
|
|
1937
2222
|
if (child == null) {
|
|
1938
2223
|
return;
|
|
1939
2224
|
}
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
didWarnInvalidOptionChildren = true;
|
|
1946
|
-
warning(false, 'Only strings and numbers are supported as <option> children.');
|
|
1947
|
-
}
|
|
2225
|
+
content += child;
|
|
2226
|
+
{
|
|
2227
|
+
if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
|
2228
|
+
didWarnInvalidOptionChildren = true;
|
|
2229
|
+
warning$1(false, 'Only strings and numbers are supported as <option> children.');
|
|
1948
2230
|
}
|
|
1949
2231
|
}
|
|
1950
2232
|
});
|
|
1951
2233
|
return content;
|
|
1952
2234
|
}
|
|
1953
2235
|
|
|
2236
|
+
var emptyObject = {};
|
|
2237
|
+
{
|
|
2238
|
+
Object.freeze(emptyObject);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
1954
2241
|
function maskContext(type, context) {
|
|
1955
2242
|
var contextTypes = type.contextTypes;
|
|
1956
2243
|
if (!contextTypes) {
|
|
@@ -1965,7 +2252,7 @@ function maskContext(type, context) {
|
|
|
1965
2252
|
|
|
1966
2253
|
function checkContextTypes(typeSpecs, values, location) {
|
|
1967
2254
|
{
|
|
1968
|
-
checkPropTypes(typeSpecs, values, location, 'Component',
|
|
2255
|
+
checkPropTypes(typeSpecs, values, location, 'Component', getCurrentServerStackImpl);
|
|
1969
2256
|
}
|
|
1970
2257
|
}
|
|
1971
2258
|
|
|
@@ -1979,6 +2266,7 @@ function processContext(type, context) {
|
|
|
1979
2266
|
return maskedContext;
|
|
1980
2267
|
}
|
|
1981
2268
|
|
|
2269
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1982
2270
|
var STYLE = 'style';
|
|
1983
2271
|
var RESERVED_PROPS = {
|
|
1984
2272
|
children: null,
|
|
@@ -1991,7 +2279,7 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
1991
2279
|
var ret = '<' + tagVerbatim;
|
|
1992
2280
|
|
|
1993
2281
|
for (var propKey in props) {
|
|
1994
|
-
if (!
|
|
2282
|
+
if (!hasOwnProperty.call(props, propKey)) {
|
|
1995
2283
|
continue;
|
|
1996
2284
|
}
|
|
1997
2285
|
var propValue = props[propKey];
|
|
@@ -2033,42 +2321,26 @@ function validateRenderResult(child, type) {
|
|
|
2033
2321
|
}
|
|
2034
2322
|
|
|
2035
2323
|
function resolve(child, context) {
|
|
2036
|
-
var element = void 0;
|
|
2037
|
-
|
|
2038
|
-
var Component = void 0;
|
|
2039
|
-
var publicContext = void 0;
|
|
2040
|
-
var inst = void 0,
|
|
2041
|
-
queue = void 0,
|
|
2042
|
-
replace = void 0;
|
|
2043
|
-
var updater = void 0;
|
|
2044
|
-
|
|
2045
|
-
var initialState = void 0;
|
|
2046
|
-
var oldQueue = void 0,
|
|
2047
|
-
oldReplace = void 0;
|
|
2048
|
-
var nextState = void 0,
|
|
2049
|
-
dontMutate = void 0;
|
|
2050
|
-
var partial = void 0,
|
|
2051
|
-
partialState = void 0;
|
|
2052
|
-
|
|
2053
|
-
var childContext = void 0;
|
|
2054
|
-
var childContextTypes = void 0,
|
|
2055
|
-
contextKey = void 0;
|
|
2056
|
-
|
|
2057
2324
|
while (React.isValidElement(child)) {
|
|
2058
2325
|
// Safe because we just checked it's an element.
|
|
2059
|
-
element = child;
|
|
2326
|
+
var element = child;
|
|
2327
|
+
var Component = element.type;
|
|
2060
2328
|
{
|
|
2061
2329
|
pushElementToDebugStack(element);
|
|
2062
2330
|
}
|
|
2063
|
-
Component = element.type;
|
|
2064
2331
|
if (typeof Component !== 'function') {
|
|
2065
2332
|
break;
|
|
2066
2333
|
}
|
|
2067
|
-
|
|
2334
|
+
processChild(element, Component);
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
// Extra closure so queue and replace can be captured properly
|
|
2338
|
+
function processChild(element, Component) {
|
|
2339
|
+
var publicContext = processContext(Component, context);
|
|
2068
2340
|
|
|
2069
|
-
queue = [];
|
|
2070
|
-
replace = false;
|
|
2071
|
-
updater = {
|
|
2341
|
+
var queue = [];
|
|
2342
|
+
var replace = false;
|
|
2343
|
+
var updater = {
|
|
2072
2344
|
isMounted: function (publicInstance) {
|
|
2073
2345
|
return false;
|
|
2074
2346
|
},
|
|
@@ -2091,6 +2363,7 @@ function resolve(child, context) {
|
|
|
2091
2363
|
}
|
|
2092
2364
|
};
|
|
2093
2365
|
|
|
2366
|
+
var inst = void 0;
|
|
2094
2367
|
if (shouldConstruct(Component)) {
|
|
2095
2368
|
inst = new Component(element.props, publicContext, updater);
|
|
2096
2369
|
|
|
@@ -2099,19 +2372,19 @@ function resolve(child, context) {
|
|
|
2099
2372
|
if (inst.state === null || inst.state === undefined) {
|
|
2100
2373
|
var componentName = getComponentName(Component) || 'Unknown';
|
|
2101
2374
|
if (!didWarnAboutUninitializedState[componentName]) {
|
|
2102
|
-
|
|
2375
|
+
warningWithoutStack$1(false, '`%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);
|
|
2103
2376
|
didWarnAboutUninitializedState[componentName] = true;
|
|
2104
2377
|
}
|
|
2105
2378
|
}
|
|
2106
2379
|
}
|
|
2107
2380
|
|
|
2108
|
-
partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2381
|
+
var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2109
2382
|
|
|
2110
2383
|
{
|
|
2111
2384
|
if (partialState === undefined) {
|
|
2112
2385
|
var _componentName = getComponentName(Component) || 'Unknown';
|
|
2113
2386
|
if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
|
2114
|
-
|
|
2387
|
+
warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
|
2115
2388
|
didWarnAboutUndefinedDerivedState[_componentName] = true;
|
|
2116
2389
|
}
|
|
2117
2390
|
}
|
|
@@ -2127,7 +2400,7 @@ function resolve(child, context) {
|
|
|
2127
2400
|
var _componentName2 = getComponentName(Component) || 'Unknown';
|
|
2128
2401
|
|
|
2129
2402
|
if (!didWarnAboutBadClass[_componentName2]) {
|
|
2130
|
-
|
|
2403
|
+
warningWithoutStack$1(false, "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);
|
|
2131
2404
|
didWarnAboutBadClass[_componentName2] = true;
|
|
2132
2405
|
}
|
|
2133
2406
|
}
|
|
@@ -2136,7 +2409,7 @@ function resolve(child, context) {
|
|
|
2136
2409
|
if (inst == null || inst.render == null) {
|
|
2137
2410
|
child = inst;
|
|
2138
2411
|
validateRenderResult(child, Component);
|
|
2139
|
-
|
|
2412
|
+
return;
|
|
2140
2413
|
}
|
|
2141
2414
|
}
|
|
2142
2415
|
|
|
@@ -2144,7 +2417,7 @@ function resolve(child, context) {
|
|
|
2144
2417
|
inst.context = publicContext;
|
|
2145
2418
|
inst.updater = updater;
|
|
2146
2419
|
|
|
2147
|
-
initialState = inst.state;
|
|
2420
|
+
var initialState = inst.state;
|
|
2148
2421
|
if (initialState === undefined) {
|
|
2149
2422
|
inst.state = initialState = null;
|
|
2150
2423
|
}
|
|
@@ -2173,25 +2446,25 @@ function resolve(child, context) {
|
|
|
2173
2446
|
inst.UNSAFE_componentWillMount();
|
|
2174
2447
|
}
|
|
2175
2448
|
if (queue.length) {
|
|
2176
|
-
oldQueue = queue;
|
|
2177
|
-
oldReplace = replace;
|
|
2449
|
+
var oldQueue = queue;
|
|
2450
|
+
var oldReplace = replace;
|
|
2178
2451
|
queue = null;
|
|
2179
2452
|
replace = false;
|
|
2180
2453
|
|
|
2181
2454
|
if (oldReplace && oldQueue.length === 1) {
|
|
2182
2455
|
inst.state = oldQueue[0];
|
|
2183
2456
|
} else {
|
|
2184
|
-
nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2185
|
-
dontMutate = true;
|
|
2457
|
+
var nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2458
|
+
var dontMutate = true;
|
|
2186
2459
|
for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
|
2187
|
-
partial = oldQueue[i];
|
|
2188
|
-
|
|
2189
|
-
if (
|
|
2460
|
+
var partial = oldQueue[i];
|
|
2461
|
+
var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
|
2462
|
+
if (_partialState != null) {
|
|
2190
2463
|
if (dontMutate) {
|
|
2191
2464
|
dontMutate = false;
|
|
2192
|
-
nextState = _assign({}, nextState,
|
|
2465
|
+
nextState = _assign({}, nextState, _partialState);
|
|
2193
2466
|
} else {
|
|
2194
|
-
_assign(nextState,
|
|
2467
|
+
_assign(nextState, _partialState);
|
|
2195
2468
|
}
|
|
2196
2469
|
}
|
|
2197
2470
|
}
|
|
@@ -2212,15 +2485,16 @@ function resolve(child, context) {
|
|
|
2212
2485
|
}
|
|
2213
2486
|
validateRenderResult(child, Component);
|
|
2214
2487
|
|
|
2488
|
+
var childContext = void 0;
|
|
2215
2489
|
if (typeof inst.getChildContext === 'function') {
|
|
2216
|
-
childContextTypes = Component.childContextTypes;
|
|
2490
|
+
var childContextTypes = Component.childContextTypes;
|
|
2217
2491
|
if (typeof childContextTypes === 'object') {
|
|
2218
2492
|
childContext = inst.getChildContext();
|
|
2219
|
-
for (contextKey in childContext) {
|
|
2493
|
+
for (var contextKey in childContext) {
|
|
2220
2494
|
!(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
|
|
2221
2495
|
}
|
|
2222
2496
|
} else {
|
|
2223
|
-
|
|
2497
|
+
warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
|
2224
2498
|
}
|
|
2225
2499
|
}
|
|
2226
2500
|
if (childContext) {
|
|
@@ -2231,6 +2505,8 @@ function resolve(child, context) {
|
|
|
2231
2505
|
}
|
|
2232
2506
|
|
|
2233
2507
|
var ReactDOMServerRenderer = function () {
|
|
2508
|
+
// DEV-only
|
|
2509
|
+
|
|
2234
2510
|
function ReactDOMServerRenderer(children, makeStaticMarkup) {
|
|
2235
2511
|
_classCallCheck(this, ReactDOMServerRenderer);
|
|
2236
2512
|
|
|
@@ -2256,33 +2532,65 @@ var ReactDOMServerRenderer = function () {
|
|
|
2256
2532
|
this.makeStaticMarkup = makeStaticMarkup;
|
|
2257
2533
|
|
|
2258
2534
|
// Context (new API)
|
|
2259
|
-
this.
|
|
2260
|
-
this.
|
|
2535
|
+
this.contextIndex = -1;
|
|
2536
|
+
this.contextStack = [];
|
|
2537
|
+
this.contextValueStack = [];
|
|
2538
|
+
{
|
|
2539
|
+
this.contextProviderStack = [];
|
|
2540
|
+
}
|
|
2261
2541
|
}
|
|
2542
|
+
|
|
2543
|
+
/**
|
|
2544
|
+
* Note: We use just two stacks regardless of how many context providers you have.
|
|
2545
|
+
* Providers are always popped in the reverse order to how they were pushed
|
|
2546
|
+
* so we always know on the way down which provider you'll encounter next on the way up.
|
|
2547
|
+
* On the way down, we push the current provider, and its context value *before*
|
|
2548
|
+
* we mutated it, onto the stacks. Therefore, on the way up, we always know which
|
|
2549
|
+
* provider needs to be "restored" to which value.
|
|
2550
|
+
* https://github.com/facebook/react/pull/12985#issuecomment-396301248
|
|
2551
|
+
*/
|
|
2552
|
+
|
|
2262
2553
|
// TODO: type this more strictly:
|
|
2263
2554
|
|
|
2264
2555
|
|
|
2265
2556
|
ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
|
2266
|
-
this.
|
|
2267
|
-
|
|
2268
|
-
var
|
|
2269
|
-
|
|
2557
|
+
var index = ++this.contextIndex;
|
|
2558
|
+
var context = provider.type._context;
|
|
2559
|
+
var previousValue = context._currentValue;
|
|
2560
|
+
|
|
2561
|
+
// Remember which value to restore this context to on our way up.
|
|
2562
|
+
this.contextStack[index] = context;
|
|
2563
|
+
this.contextValueStack[index] = previousValue;
|
|
2564
|
+
{
|
|
2565
|
+
// Only used for push/pop mismatch warnings.
|
|
2566
|
+
this.contextProviderStack[index] = provider;
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
// Mutate the current value.
|
|
2570
|
+
context._currentValue = provider.props.value;
|
|
2270
2571
|
};
|
|
2271
2572
|
|
|
2272
2573
|
ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
|
2574
|
+
var index = this.contextIndex;
|
|
2273
2575
|
{
|
|
2274
|
-
|
|
2576
|
+
!(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
|
|
2275
2577
|
}
|
|
2276
|
-
|
|
2277
|
-
this.
|
|
2278
|
-
var
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2578
|
+
|
|
2579
|
+
var context = this.contextStack[index];
|
|
2580
|
+
var previousValue = this.contextValueStack[index];
|
|
2581
|
+
|
|
2582
|
+
// "Hide" these null assignments from Flow by using `any`
|
|
2583
|
+
// because conceptually they are deletions--as long as we
|
|
2584
|
+
// promise to never access values beyond `this.contextIndex`.
|
|
2585
|
+
this.contextStack[index] = null;
|
|
2586
|
+
this.contextValueStack[index] = null;
|
|
2587
|
+
{
|
|
2588
|
+
this.contextProviderStack[index] = null;
|
|
2285
2589
|
}
|
|
2590
|
+
this.contextIndex--;
|
|
2591
|
+
|
|
2592
|
+
// Restore to the previous value we stored as we were walking down.
|
|
2593
|
+
context._currentValue = previousValue;
|
|
2286
2594
|
};
|
|
2287
2595
|
|
|
2288
2596
|
ReactDOMServerRenderer.prototype.read = function read(bytes) {
|
|
@@ -2314,12 +2622,15 @@ var ReactDOMServerRenderer = function () {
|
|
|
2314
2622
|
}
|
|
2315
2623
|
var child = frame.children[frame.childIndex++];
|
|
2316
2624
|
{
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2625
|
+
pushCurrentDebugStack(this.stack);
|
|
2626
|
+
// We're starting work on this frame, so reset its inner stack.
|
|
2627
|
+
frame.debugElementStack.length = 0;
|
|
2628
|
+
try {
|
|
2629
|
+
// Be careful! Make sure this matches the PROD path below.
|
|
2630
|
+
out += this.render(child, frame.context, frame.domNamespace);
|
|
2631
|
+
} finally {
|
|
2632
|
+
popCurrentDebugStack();
|
|
2633
|
+
}
|
|
2323
2634
|
}
|
|
2324
2635
|
}
|
|
2325
2636
|
return out;
|
|
@@ -2383,6 +2694,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2383
2694
|
switch (elementType) {
|
|
2384
2695
|
case REACT_STRICT_MODE_TYPE:
|
|
2385
2696
|
case REACT_ASYNC_MODE_TYPE:
|
|
2697
|
+
case REACT_PROFILER_TYPE:
|
|
2386
2698
|
case REACT_FRAGMENT_TYPE:
|
|
2387
2699
|
{
|
|
2388
2700
|
var _nextChildren = toArray(nextChild.props.children);
|
|
@@ -2400,56 +2712,92 @@ var ReactDOMServerRenderer = function () {
|
|
|
2400
2712
|
this.stack.push(_frame);
|
|
2401
2713
|
return '';
|
|
2402
2714
|
}
|
|
2403
|
-
case
|
|
2404
|
-
|
|
2405
|
-
|
|
2715
|
+
case REACT_PLACEHOLDER_TYPE:
|
|
2716
|
+
{
|
|
2717
|
+
if (enableSuspenseServerRenderer) {
|
|
2718
|
+
var _nextChildren2 = toArray(
|
|
2719
|
+
// Always use the fallback when synchronously rendering to string.
|
|
2720
|
+
nextChild.props.fallback);
|
|
2721
|
+
var _frame2 = {
|
|
2722
|
+
type: null,
|
|
2723
|
+
domNamespace: parentNamespace,
|
|
2724
|
+
children: _nextChildren2,
|
|
2725
|
+
childIndex: 0,
|
|
2726
|
+
context: context,
|
|
2727
|
+
footer: ''
|
|
2728
|
+
};
|
|
2729
|
+
{
|
|
2730
|
+
_frame2.debugElementStack = [];
|
|
2731
|
+
}
|
|
2732
|
+
this.stack.push(_frame2);
|
|
2733
|
+
return '';
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2406
2736
|
// eslint-disable-next-line-no-fallthrough
|
|
2407
2737
|
default:
|
|
2408
2738
|
break;
|
|
2409
2739
|
}
|
|
2410
2740
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
2411
2741
|
switch (elementType.$$typeof) {
|
|
2742
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2743
|
+
{
|
|
2744
|
+
var element = nextChild;
|
|
2745
|
+
var _nextChildren3 = toArray(elementType.render(element.props, element.ref));
|
|
2746
|
+
var _frame3 = {
|
|
2747
|
+
type: null,
|
|
2748
|
+
domNamespace: parentNamespace,
|
|
2749
|
+
children: _nextChildren3,
|
|
2750
|
+
childIndex: 0,
|
|
2751
|
+
context: context,
|
|
2752
|
+
footer: ''
|
|
2753
|
+
};
|
|
2754
|
+
{
|
|
2755
|
+
_frame3.debugElementStack = [];
|
|
2756
|
+
}
|
|
2757
|
+
this.stack.push(_frame3);
|
|
2758
|
+
return '';
|
|
2759
|
+
}
|
|
2412
2760
|
case REACT_PROVIDER_TYPE:
|
|
2413
2761
|
{
|
|
2414
2762
|
var provider = nextChild;
|
|
2415
2763
|
var nextProps = provider.props;
|
|
2416
|
-
var
|
|
2417
|
-
var
|
|
2764
|
+
var _nextChildren4 = toArray(nextProps.children);
|
|
2765
|
+
var _frame4 = {
|
|
2418
2766
|
type: provider,
|
|
2419
2767
|
domNamespace: parentNamespace,
|
|
2420
|
-
children:
|
|
2768
|
+
children: _nextChildren4,
|
|
2421
2769
|
childIndex: 0,
|
|
2422
2770
|
context: context,
|
|
2423
2771
|
footer: ''
|
|
2424
2772
|
};
|
|
2425
2773
|
{
|
|
2426
|
-
|
|
2774
|
+
_frame4.debugElementStack = [];
|
|
2427
2775
|
}
|
|
2428
2776
|
|
|
2429
2777
|
this.pushProvider(provider);
|
|
2430
2778
|
|
|
2431
|
-
this.stack.push(
|
|
2779
|
+
this.stack.push(_frame4);
|
|
2432
2780
|
return '';
|
|
2433
2781
|
}
|
|
2434
2782
|
case REACT_CONTEXT_TYPE:
|
|
2435
2783
|
{
|
|
2436
2784
|
var consumer = nextChild;
|
|
2437
2785
|
var _nextProps = consumer.props;
|
|
2438
|
-
var nextValue = consumer.type.
|
|
2786
|
+
var nextValue = consumer.type._currentValue;
|
|
2439
2787
|
|
|
2440
|
-
var
|
|
2441
|
-
var
|
|
2788
|
+
var _nextChildren5 = toArray(_nextProps.children(nextValue));
|
|
2789
|
+
var _frame5 = {
|
|
2442
2790
|
type: nextChild,
|
|
2443
2791
|
domNamespace: parentNamespace,
|
|
2444
|
-
children:
|
|
2792
|
+
children: _nextChildren5,
|
|
2445
2793
|
childIndex: 0,
|
|
2446
2794
|
context: context,
|
|
2447
2795
|
footer: ''
|
|
2448
2796
|
};
|
|
2449
2797
|
{
|
|
2450
|
-
|
|
2798
|
+
_frame5.debugElementStack = [];
|
|
2451
2799
|
}
|
|
2452
|
-
this.stack.push(
|
|
2800
|
+
this.stack.push(_frame5);
|
|
2453
2801
|
return '';
|
|
2454
2802
|
}
|
|
2455
2803
|
default:
|
|
@@ -2484,7 +2832,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2484
2832
|
if (namespace === Namespaces.html) {
|
|
2485
2833
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
2486
2834
|
// allow <SVG> or <mATH>.
|
|
2487
|
-
|
|
2835
|
+
!(tag === element.type) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
|
|
2488
2836
|
}
|
|
2489
2837
|
}
|
|
2490
2838
|
|
|
@@ -2493,14 +2841,14 @@ var ReactDOMServerRenderer = function () {
|
|
|
2493
2841
|
var props = element.props;
|
|
2494
2842
|
if (tag === 'input') {
|
|
2495
2843
|
{
|
|
2496
|
-
ReactControlledValuePropTypes.checkPropTypes('input', props
|
|
2844
|
+
ReactControlledValuePropTypes.checkPropTypes('input', props);
|
|
2497
2845
|
|
|
2498
2846
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
|
2499
|
-
warning(false, '%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);
|
|
2847
|
+
warning$1(false, '%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);
|
|
2500
2848
|
didWarnDefaultChecked = true;
|
|
2501
2849
|
}
|
|
2502
2850
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
|
2503
|
-
warning(false, '%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);
|
|
2851
|
+
warning$1(false, '%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);
|
|
2504
2852
|
didWarnDefaultInputValue = true;
|
|
2505
2853
|
}
|
|
2506
2854
|
}
|
|
@@ -2515,9 +2863,9 @@ var ReactDOMServerRenderer = function () {
|
|
|
2515
2863
|
});
|
|
2516
2864
|
} else if (tag === 'textarea') {
|
|
2517
2865
|
{
|
|
2518
|
-
ReactControlledValuePropTypes.checkPropTypes('textarea', props
|
|
2866
|
+
ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
|
2519
2867
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
|
2520
|
-
warning(false, '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');
|
|
2868
|
+
warning$1(false, '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');
|
|
2521
2869
|
didWarnDefaultTextareaValue = true;
|
|
2522
2870
|
}
|
|
2523
2871
|
}
|
|
@@ -2529,7 +2877,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2529
2877
|
var textareaChildren = props.children;
|
|
2530
2878
|
if (textareaChildren != null) {
|
|
2531
2879
|
{
|
|
2532
|
-
warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
2880
|
+
warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
2533
2881
|
}
|
|
2534
2882
|
!(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
|
|
2535
2883
|
if (Array.isArray(textareaChildren)) {
|
|
@@ -2551,7 +2899,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2551
2899
|
});
|
|
2552
2900
|
} else if (tag === 'select') {
|
|
2553
2901
|
{
|
|
2554
|
-
ReactControlledValuePropTypes.checkPropTypes('select', props
|
|
2902
|
+
ReactControlledValuePropTypes.checkPropTypes('select', props);
|
|
2555
2903
|
|
|
2556
2904
|
for (var i = 0; i < valuePropNames.length; i++) {
|
|
2557
2905
|
var propName = valuePropNames[i];
|
|
@@ -2560,14 +2908,14 @@ var ReactDOMServerRenderer = function () {
|
|
|
2560
2908
|
}
|
|
2561
2909
|
var isArray = Array.isArray(props[propName]);
|
|
2562
2910
|
if (props.multiple && !isArray) {
|
|
2563
|
-
warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true
|
|
2911
|
+
warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
|
2564
2912
|
} else if (!props.multiple && isArray) {
|
|
2565
|
-
warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false
|
|
2913
|
+
warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
|
2566
2914
|
}
|
|
2567
2915
|
}
|
|
2568
2916
|
|
|
2569
2917
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
|
2570
|
-
warning(false, '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');
|
|
2918
|
+
warning$1(false, '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');
|
|
2571
2919
|
didWarnDefaultSelectValue = true;
|
|
2572
2920
|
}
|
|
2573
2921
|
}
|
|
@@ -2613,7 +2961,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2613
2961
|
validatePropertiesInDevelopment(tag, props);
|
|
2614
2962
|
}
|
|
2615
2963
|
|
|
2616
|
-
assertValidProps(tag, props
|
|
2964
|
+
assertValidProps(tag, props);
|
|
2617
2965
|
|
|
2618
2966
|
var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
|
|
2619
2967
|
var footer = '';
|
|
@@ -2710,7 +3058,7 @@ var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || Rea
|
|
|
2710
3058
|
|
|
2711
3059
|
// TODO: decide on the top-level export form.
|
|
2712
3060
|
// This is hacky but makes it work with both Rollup and Jest
|
|
2713
|
-
var server_browser = ReactDOMServer
|
|
3061
|
+
var server_browser = ReactDOMServer.default || ReactDOMServer;
|
|
2714
3062
|
|
|
2715
3063
|
module.exports = server_browser;
|
|
2716
3064
|
})();
|