react-dom 16.1.2 → 16.2.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/cjs/react-dom-server.browser.development.js +68 -51
- package/cjs/react-dom-server.browser.production.min.js +20 -19
- package/cjs/react-dom-server.node.development.js +69 -52
- package/cjs/react-dom-server.node.production.min.js +22 -21
- package/cjs/react-dom-test-utils.development.js +8 -1
- package/cjs/react-dom-test-utils.production.min.js +2 -1
- package/cjs/react-dom-unstable-native-dependencies.development.js +3 -1
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +2 -1
- package/cjs/react-dom.development.js +297 -303
- package/cjs/react-dom.production.min.js +209 -207
- package/package.json +1 -1
- package/umd/react-dom-server.browser.development.js +120 -105
- package/umd/react-dom-server.browser.production.min.js +26 -27
- package/umd/react-dom-test-utils.development.js +1247 -0
- package/umd/react-dom-test-utils.production.min.js +29 -0
- package/umd/react-dom-unstable-native-dependencies.development.js +16 -16
- package/umd/react-dom-unstable-native-dependencies.production.min.js +1 -1
- package/umd/react-dom.development.js +511 -519
- package/umd/react-dom.production.min.js +182 -182
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.2.0
|
|
2
2
|
* react-dom-server.browser.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -74,7 +74,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var invariant_1
|
|
77
|
+
var invariant_1 = invariant;
|
|
78
78
|
|
|
79
79
|
// These attributes should be all lowercase to allow for
|
|
80
80
|
// case insensitive checks
|
|
@@ -136,7 +136,7 @@ var DOMPropertyInjection = {
|
|
|
136
136
|
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
|
|
137
137
|
|
|
138
138
|
for (var propName in Properties) {
|
|
139
|
-
!!properties.hasOwnProperty(propName) ? invariant_1
|
|
139
|
+
!!properties.hasOwnProperty(propName) ? invariant_1(false, "injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.", propName) : void 0;
|
|
140
140
|
|
|
141
141
|
var lowerCased = propName.toLowerCase();
|
|
142
142
|
var propConfig = Properties[propName];
|
|
@@ -154,7 +154,7 @@ var DOMPropertyInjection = {
|
|
|
154
154
|
hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE),
|
|
155
155
|
hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE)
|
|
156
156
|
};
|
|
157
|
-
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant_1
|
|
157
|
+
!(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant_1(false, "DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s", propName) : void 0;
|
|
158
158
|
|
|
159
159
|
if (DOMAttributeNames.hasOwnProperty(propName)) {
|
|
160
160
|
var attributeName = DOMAttributeNames[propName];
|
|
@@ -443,7 +443,7 @@ injection.injectDOMPropertyConfig(SVGDOMPropertyConfig);
|
|
|
443
443
|
|
|
444
444
|
// TODO: this is special because it gets imported during build.
|
|
445
445
|
|
|
446
|
-
var ReactVersion = '16.
|
|
446
|
+
var ReactVersion = '16.2.0';
|
|
447
447
|
|
|
448
448
|
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
449
449
|
|
|
@@ -657,7 +657,7 @@ var warning = emptyFunction_1;
|
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
-
var warning_1
|
|
660
|
+
var warning_1 = warning;
|
|
661
661
|
|
|
662
662
|
/**
|
|
663
663
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -682,8 +682,8 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
|
682
682
|
|
|
683
683
|
|
|
684
684
|
{
|
|
685
|
-
var invariant$2 = invariant_1
|
|
686
|
-
var warning$2 = warning_1
|
|
685
|
+
var invariant$2 = invariant_1;
|
|
686
|
+
var warning$2 = warning_1;
|
|
687
687
|
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
688
688
|
var loggedTypeFailures = {};
|
|
689
689
|
}
|
|
@@ -730,7 +730,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
|
|
733
|
-
var checkPropTypes_1
|
|
733
|
+
var checkPropTypes_1 = checkPropTypes;
|
|
734
734
|
|
|
735
735
|
var describeComponentFrame = function (name, source, ownerName) {
|
|
736
736
|
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
@@ -738,9 +738,19 @@ var describeComponentFrame = function (name, source, ownerName) {
|
|
|
738
738
|
|
|
739
739
|
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
740
740
|
|
|
741
|
-
|
|
741
|
+
var ReactCurrentOwner = ReactInternals$1.ReactCurrentOwner;
|
|
742
742
|
var ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;
|
|
743
743
|
|
|
744
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
745
|
+
// nor polyfill, then a plain number is used for performance.
|
|
746
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol['for'];
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb;
|
|
753
|
+
|
|
744
754
|
// code copied and modified from escape-html
|
|
745
755
|
/**
|
|
746
756
|
* Module variables.
|
|
@@ -750,9 +760,9 @@ var ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;
|
|
|
750
760
|
var matchHtmlRegExp = /["'&<>]/;
|
|
751
761
|
|
|
752
762
|
/**
|
|
753
|
-
*
|
|
763
|
+
* Escapes special characters and HTML entities in a given html string.
|
|
754
764
|
*
|
|
755
|
-
* @param {string} string
|
|
765
|
+
* @param {string} string HTML string to escape for later insertion
|
|
756
766
|
* @return {string}
|
|
757
767
|
* @public
|
|
758
768
|
*/
|
|
@@ -814,7 +824,7 @@ function escapeHtml(string) {
|
|
|
814
824
|
* @param {*} text Text value to escape.
|
|
815
825
|
* @return {string} An escaped string.
|
|
816
826
|
*/
|
|
817
|
-
function
|
|
827
|
+
function escapeTextForBrowser(text) {
|
|
818
828
|
if (typeof text === 'boolean' || typeof text === 'number') {
|
|
819
829
|
// this shortcircuit helps perf for types that we know will never have
|
|
820
830
|
// special characters, especially given that this function is used often
|
|
@@ -831,7 +841,7 @@ function escapeTextContentForBrowser(text) {
|
|
|
831
841
|
* @return {string} An escaped string.
|
|
832
842
|
*/
|
|
833
843
|
function quoteAttributeValueForBrowser(value) {
|
|
834
|
-
return '"' +
|
|
844
|
+
return '"' + escapeTextForBrowser(value) + '"';
|
|
835
845
|
}
|
|
836
846
|
|
|
837
847
|
// isAttributeNameSafe() is currently duplicated in DOMPropertyOperations.
|
|
@@ -852,7 +862,7 @@ function isAttributeNameSafe(attributeName) {
|
|
|
852
862
|
}
|
|
853
863
|
illegalAttributeNameCache[attributeName] = true;
|
|
854
864
|
{
|
|
855
|
-
warning_1
|
|
865
|
+
warning_1(false, 'Invalid attribute name: `%s`', attributeName);
|
|
856
866
|
}
|
|
857
867
|
return false;
|
|
858
868
|
}
|
|
@@ -898,7 +908,7 @@ function createMarkupForProperty(name, value) {
|
|
|
898
908
|
} else if (typeof value !== 'boolean' || shouldAttributeAcceptBooleanValue(name)) {
|
|
899
909
|
return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
|
900
910
|
}
|
|
901
|
-
} else if (shouldSetAttribute(name, value)
|
|
911
|
+
} else if (shouldSetAttribute(name, value)) {
|
|
902
912
|
if (value == null) {
|
|
903
913
|
return '';
|
|
904
914
|
}
|
|
@@ -991,7 +1001,7 @@ var ReactControlledValuePropTypes = {
|
|
|
991
1001
|
* this outside of the ReactDOM controlled form components.
|
|
992
1002
|
*/
|
|
993
1003
|
ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) {
|
|
994
|
-
checkPropTypes_1
|
|
1004
|
+
checkPropTypes_1(propTypes, props, 'prop', tagName, getStack);
|
|
995
1005
|
};
|
|
996
1006
|
}
|
|
997
1007
|
|
|
@@ -1031,16 +1041,16 @@ function assertValidProps(tag, props, getStack) {
|
|
|
1031
1041
|
}
|
|
1032
1042
|
// Note the use of `==` which checks for null or undefined.
|
|
1033
1043
|
if (voidElementTags[tag]) {
|
|
1034
|
-
!(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant_1
|
|
1044
|
+
!(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant_1(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getStack()) : void 0;
|
|
1035
1045
|
}
|
|
1036
1046
|
if (props.dangerouslySetInnerHTML != null) {
|
|
1037
|
-
!(props.children == null) ? invariant_1
|
|
1038
|
-
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant_1
|
|
1047
|
+
!(props.children == null) ? invariant_1(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
|
|
1048
|
+
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant_1(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;
|
|
1039
1049
|
}
|
|
1040
1050
|
{
|
|
1041
|
-
warning_1
|
|
1051
|
+
warning_1(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, '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.%s', getStack());
|
|
1042
1052
|
}
|
|
1043
|
-
!(props.style == null || typeof props.style === 'object') ? invariant_1
|
|
1053
|
+
!(props.style == null || typeof props.style === 'object') ? invariant_1(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', getStack()) : void 0;
|
|
1044
1054
|
}
|
|
1045
1055
|
|
|
1046
1056
|
/**
|
|
@@ -1235,7 +1245,7 @@ function camelizeStyleName(string) {
|
|
|
1235
1245
|
return camelize_1(string.replace(msPattern$1, 'ms-'));
|
|
1236
1246
|
}
|
|
1237
1247
|
|
|
1238
|
-
var camelizeStyleName_1
|
|
1248
|
+
var camelizeStyleName_1 = camelizeStyleName;
|
|
1239
1249
|
|
|
1240
1250
|
var warnValidStyle = emptyFunction_1;
|
|
1241
1251
|
|
|
@@ -1257,7 +1267,7 @@ var warnValidStyle = emptyFunction_1;
|
|
|
1257
1267
|
}
|
|
1258
1268
|
|
|
1259
1269
|
warnedStyleNames[name] = true;
|
|
1260
|
-
warning_1
|
|
1270
|
+
warning_1(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName_1(name), getStack());
|
|
1261
1271
|
};
|
|
1262
1272
|
|
|
1263
1273
|
var warnBadVendoredStyleName = function (name, getStack) {
|
|
@@ -1266,7 +1276,7 @@ var warnValidStyle = emptyFunction_1;
|
|
|
1266
1276
|
}
|
|
1267
1277
|
|
|
1268
1278
|
warnedStyleNames[name] = true;
|
|
1269
|
-
warning_1
|
|
1279
|
+
warning_1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), getStack());
|
|
1270
1280
|
};
|
|
1271
1281
|
|
|
1272
1282
|
var warnStyleValueWithSemicolon = function (name, value, getStack) {
|
|
@@ -1275,7 +1285,7 @@ var warnValidStyle = emptyFunction_1;
|
|
|
1275
1285
|
}
|
|
1276
1286
|
|
|
1277
1287
|
warnedStyleValues[value] = true;
|
|
1278
|
-
warning_1
|
|
1288
|
+
warning_1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.%s', name, value.replace(badStyleValueWithSemicolonPattern, ''), getStack());
|
|
1279
1289
|
};
|
|
1280
1290
|
|
|
1281
1291
|
var warnStyleValueIsNaN = function (name, value, getStack) {
|
|
@@ -1284,7 +1294,7 @@ var warnValidStyle = emptyFunction_1;
|
|
|
1284
1294
|
}
|
|
1285
1295
|
|
|
1286
1296
|
warnedForNaNValue = true;
|
|
1287
|
-
warning_1
|
|
1297
|
+
warning_1(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, getStack());
|
|
1288
1298
|
};
|
|
1289
1299
|
|
|
1290
1300
|
var warnStyleValueIsInfinity = function (name, value, getStack) {
|
|
@@ -1293,7 +1303,7 @@ var warnValidStyle = emptyFunction_1;
|
|
|
1293
1303
|
}
|
|
1294
1304
|
|
|
1295
1305
|
warnedForInfinityValue = true;
|
|
1296
|
-
warning_1
|
|
1306
|
+
warning_1(false, '`Infinity` is an invalid value for the `%s` css style property.%s', name, getStack());
|
|
1297
1307
|
};
|
|
1298
1308
|
|
|
1299
1309
|
warnValidStyle = function (name, value, getStack) {
|
|
@@ -1395,13 +1405,13 @@ function validateProperty(tagName, name) {
|
|
|
1395
1405
|
// If this is an aria-* attribute, but is not listed in the known DOM
|
|
1396
1406
|
// DOM properties, then it is an invalid aria-* attribute.
|
|
1397
1407
|
if (correctName == null) {
|
|
1398
|
-
warning_1
|
|
1408
|
+
warning_1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.%s', name, getStackAddendum$1());
|
|
1399
1409
|
warnedProperties[name] = true;
|
|
1400
1410
|
return true;
|
|
1401
1411
|
}
|
|
1402
1412
|
// aria-* attributes should be lowercase; suggest the lowercase version.
|
|
1403
1413
|
if (name !== correctName) {
|
|
1404
|
-
warning_1
|
|
1414
|
+
warning_1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?%s', name, correctName, getStackAddendum$1());
|
|
1405
1415
|
warnedProperties[name] = true;
|
|
1406
1416
|
return true;
|
|
1407
1417
|
}
|
|
@@ -1419,7 +1429,7 @@ function validateProperty(tagName, name) {
|
|
|
1419
1429
|
}
|
|
1420
1430
|
// aria-* attributes should be lowercase; suggest the lowercase version.
|
|
1421
1431
|
if (name !== standardName) {
|
|
1422
|
-
warning_1
|
|
1432
|
+
warning_1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$1());
|
|
1423
1433
|
warnedProperties[name] = true;
|
|
1424
1434
|
return true;
|
|
1425
1435
|
}
|
|
@@ -1443,9 +1453,9 @@ function warnInvalidARIAProps(type, props) {
|
|
|
1443
1453
|
}).join(', ');
|
|
1444
1454
|
|
|
1445
1455
|
if (invalidProps.length === 1) {
|
|
1446
|
-
warning_1
|
|
1456
|
+
warning_1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$1());
|
|
1447
1457
|
} else if (invalidProps.length > 1) {
|
|
1448
|
-
warning_1
|
|
1458
|
+
warning_1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$1());
|
|
1449
1459
|
}
|
|
1450
1460
|
}
|
|
1451
1461
|
|
|
@@ -1471,9 +1481,9 @@ function validateProperties$1(type, props) {
|
|
|
1471
1481
|
if (props != null && props.value === null && !didWarnValueNull) {
|
|
1472
1482
|
didWarnValueNull = true;
|
|
1473
1483
|
if (type === 'select' && props.multiple) {
|
|
1474
|
-
warning_1
|
|
1484
|
+
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.%s', type, getStackAddendum$2());
|
|
1475
1485
|
} else {
|
|
1476
|
-
warning_1
|
|
1486
|
+
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.%s', type, getStackAddendum$2());
|
|
1477
1487
|
}
|
|
1478
1488
|
}
|
|
1479
1489
|
}
|
|
@@ -1487,7 +1497,7 @@ function validateProperties$1(type, props) {
|
|
|
1487
1497
|
/**
|
|
1488
1498
|
* Ordered list of injected plugins.
|
|
1489
1499
|
*/
|
|
1490
|
-
|
|
1500
|
+
|
|
1491
1501
|
|
|
1492
1502
|
/**
|
|
1493
1503
|
* Mapping from event name to dispatch config
|
|
@@ -2031,36 +2041,46 @@ function getStackAddendum$3() {
|
|
|
2031
2041
|
{
|
|
2032
2042
|
var warnedProperties$1 = {};
|
|
2033
2043
|
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
2034
|
-
var EVENT_NAME_REGEX = /^on
|
|
2044
|
+
var EVENT_NAME_REGEX = /^on./;
|
|
2045
|
+
var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
|
2035
2046
|
var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
2036
2047
|
var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
|
2037
2048
|
|
|
2038
|
-
var validateProperty$1 = function (tagName, name, value) {
|
|
2049
|
+
var validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
|
|
2039
2050
|
if (hasOwnProperty$1.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
|
2040
2051
|
return true;
|
|
2041
2052
|
}
|
|
2042
2053
|
|
|
2043
|
-
if (registrationNameModules.hasOwnProperty(name)) {
|
|
2044
|
-
return true;
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
if (plugins.length === 0 && EVENT_NAME_REGEX.test(name)) {
|
|
2048
|
-
// If no event plugins have been injected, we might be in a server environment.
|
|
2049
|
-
// Don't check events in this case.
|
|
2050
|
-
return true;
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
2054
|
var lowerCasedName = name.toLowerCase();
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
if (registrationName != null) {
|
|
2057
|
-
warning_1$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$3());
|
|
2055
|
+
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
2056
|
+
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.');
|
|
2058
2057
|
warnedProperties$1[name] = true;
|
|
2059
2058
|
return true;
|
|
2060
2059
|
}
|
|
2061
2060
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2061
|
+
// We can't rely on the event system being injected on the server.
|
|
2062
|
+
if (canUseEventSystem) {
|
|
2063
|
+
if (registrationNameModules.hasOwnProperty(name)) {
|
|
2064
|
+
return true;
|
|
2065
|
+
}
|
|
2066
|
+
var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
|
2067
|
+
if (registrationName != null) {
|
|
2068
|
+
warning_1(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$3());
|
|
2069
|
+
warnedProperties$1[name] = true;
|
|
2070
|
+
return true;
|
|
2071
|
+
}
|
|
2072
|
+
if (EVENT_NAME_REGEX.test(name)) {
|
|
2073
|
+
warning_1(false, 'Unknown event handler property `%s`. It will be ignored.%s', name, getStackAddendum$3());
|
|
2074
|
+
warnedProperties$1[name] = true;
|
|
2075
|
+
return true;
|
|
2076
|
+
}
|
|
2077
|
+
} else if (EVENT_NAME_REGEX.test(name)) {
|
|
2078
|
+
// If no event plugins have been injected, we are in a server environment.
|
|
2079
|
+
// So we can't tell if the event name is correct for sure, but we can filter
|
|
2080
|
+
// out known bad ones like `onclick`. We can't suggest a specific replacement though.
|
|
2081
|
+
if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
|
2082
|
+
warning_1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.%s', name, getStackAddendum$3());
|
|
2083
|
+
}
|
|
2064
2084
|
warnedProperties$1[name] = true;
|
|
2065
2085
|
return true;
|
|
2066
2086
|
}
|
|
@@ -2070,32 +2090,26 @@ function getStackAddendum$3() {
|
|
|
2070
2090
|
return true;
|
|
2071
2091
|
}
|
|
2072
2092
|
|
|
2073
|
-
if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
|
2074
|
-
warning_1$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.');
|
|
2075
|
-
warnedProperties$1[name] = true;
|
|
2076
|
-
return true;
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
2093
|
if (lowerCasedName === 'innerhtml') {
|
|
2080
|
-
warning_1
|
|
2094
|
+
warning_1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
|
2081
2095
|
warnedProperties$1[name] = true;
|
|
2082
2096
|
return true;
|
|
2083
2097
|
}
|
|
2084
2098
|
|
|
2085
2099
|
if (lowerCasedName === 'aria') {
|
|
2086
|
-
warning_1
|
|
2100
|
+
warning_1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
|
2087
2101
|
warnedProperties$1[name] = true;
|
|
2088
2102
|
return true;
|
|
2089
2103
|
}
|
|
2090
2104
|
|
|
2091
2105
|
if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
|
2092
|
-
warning_1
|
|
2106
|
+
warning_1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum$3());
|
|
2093
2107
|
warnedProperties$1[name] = true;
|
|
2094
2108
|
return true;
|
|
2095
2109
|
}
|
|
2096
2110
|
|
|
2097
2111
|
if (typeof value === 'number' && isNaN(value)) {
|
|
2098
|
-
warning_1
|
|
2112
|
+
warning_1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum$3());
|
|
2099
2113
|
warnedProperties$1[name] = true;
|
|
2100
2114
|
return true;
|
|
2101
2115
|
}
|
|
@@ -2106,23 +2120,23 @@ function getStackAddendum$3() {
|
|
|
2106
2120
|
if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
|
2107
2121
|
var standardName = possibleStandardNames[lowerCasedName];
|
|
2108
2122
|
if (standardName !== name) {
|
|
2109
|
-
warning_1
|
|
2123
|
+
warning_1(false, 'Invalid DOM property `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$3());
|
|
2110
2124
|
warnedProperties$1[name] = true;
|
|
2111
2125
|
return true;
|
|
2112
2126
|
}
|
|
2113
2127
|
} else if (!isReserved && name !== lowerCasedName) {
|
|
2114
2128
|
// Unknown attributes should have lowercase casing since that's how they
|
|
2115
2129
|
// will be cased anyway with server rendering.
|
|
2116
|
-
warning_1
|
|
2130
|
+
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.%s', name, lowerCasedName, getStackAddendum$3());
|
|
2117
2131
|
warnedProperties$1[name] = true;
|
|
2118
2132
|
return true;
|
|
2119
2133
|
}
|
|
2120
2134
|
|
|
2121
2135
|
if (typeof value === 'boolean' && !shouldAttributeAcceptBooleanValue(name)) {
|
|
2122
2136
|
if (value) {
|
|
2123
|
-
warning_1
|
|
2137
|
+
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()}.%s', value, name, name, value, name, getStackAddendum$3());
|
|
2124
2138
|
} else {
|
|
2125
|
-
warning_1
|
|
2139
|
+
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.%s', value, name, name, value, name, name, name, getStackAddendum$3());
|
|
2126
2140
|
}
|
|
2127
2141
|
warnedProperties$1[name] = true;
|
|
2128
2142
|
return true;
|
|
@@ -2144,10 +2158,10 @@ function getStackAddendum$3() {
|
|
|
2144
2158
|
};
|
|
2145
2159
|
}
|
|
2146
2160
|
|
|
2147
|
-
var warnUnknownProperties = function (type, props) {
|
|
2161
|
+
var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
|
2148
2162
|
var unknownProps = [];
|
|
2149
2163
|
for (var key in props) {
|
|
2150
|
-
var isValid = validateProperty$1(type, key, props[key]);
|
|
2164
|
+
var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
|
2151
2165
|
if (!isValid) {
|
|
2152
2166
|
unknownProps.push(key);
|
|
2153
2167
|
}
|
|
@@ -2157,23 +2171,21 @@ var warnUnknownProperties = function (type, props) {
|
|
|
2157
2171
|
return '`' + prop + '`';
|
|
2158
2172
|
}).join(', ');
|
|
2159
2173
|
if (unknownProps.length === 1) {
|
|
2160
|
-
warning_1
|
|
2174
|
+
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%s', unknownPropString, type, getStackAddendum$3());
|
|
2161
2175
|
} else if (unknownProps.length > 1) {
|
|
2162
|
-
warning_1
|
|
2176
|
+
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%s', unknownPropString, type, getStackAddendum$3());
|
|
2163
2177
|
}
|
|
2164
2178
|
};
|
|
2165
2179
|
|
|
2166
|
-
function validateProperties$2(type, props) {
|
|
2180
|
+
function validateProperties$2(type, props, canUseEventSystem) {
|
|
2167
2181
|
if (isCustomComponent(type, props)) {
|
|
2168
2182
|
return;
|
|
2169
2183
|
}
|
|
2170
|
-
warnUnknownProperties(type, props);
|
|
2184
|
+
warnUnknownProperties(type, props, canUseEventSystem);
|
|
2171
2185
|
}
|
|
2172
2186
|
|
|
2173
2187
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2174
2188
|
|
|
2175
|
-
var REACT_FRAGMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.fragment') || 0xeacb;
|
|
2176
|
-
|
|
2177
2189
|
// Based on reading the React.Children implementation. TODO: type this somewhere?
|
|
2178
2190
|
|
|
2179
2191
|
var toArray = React.Children.toArray;
|
|
@@ -2184,7 +2196,7 @@ var getStackAddendum = emptyFunction_1.thatReturns('');
|
|
|
2184
2196
|
var validatePropertiesInDevelopment = function (type, props) {
|
|
2185
2197
|
validateProperties(type, props);
|
|
2186
2198
|
validateProperties$1(type, props);
|
|
2187
|
-
validateProperties$2(type, props);
|
|
2199
|
+
validateProperties$2(type, props, /* canUseEventSystem */false);
|
|
2188
2200
|
};
|
|
2189
2201
|
|
|
2190
2202
|
var describeStackFrame = function (element) {
|
|
@@ -2256,7 +2268,7 @@ var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
|
|
|
2256
2268
|
var validatedTagCache = {};
|
|
2257
2269
|
function validateDangerousTag(tag) {
|
|
2258
2270
|
if (!validatedTagCache.hasOwnProperty(tag)) {
|
|
2259
|
-
!VALID_TAG_REGEX.test(tag) ? invariant_1
|
|
2271
|
+
!VALID_TAG_REGEX.test(tag) ? invariant_1(false, 'Invalid tag: %s', tag) : void 0;
|
|
2260
2272
|
validatedTagCache[tag] = true;
|
|
2261
2273
|
}
|
|
2262
2274
|
}
|
|
@@ -2298,7 +2310,7 @@ function warnNoop(publicInstance, callerName) {
|
|
|
2298
2310
|
return;
|
|
2299
2311
|
}
|
|
2300
2312
|
|
|
2301
|
-
warning_1
|
|
2313
|
+
warning_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);
|
|
2302
2314
|
didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
|
2303
2315
|
}
|
|
2304
2316
|
}
|
|
@@ -2316,7 +2328,7 @@ function getNonChildrenInnerMarkup(props) {
|
|
|
2316
2328
|
} else {
|
|
2317
2329
|
var content = props.children;
|
|
2318
2330
|
if (typeof content === 'string' || typeof content === 'number') {
|
|
2319
|
-
return
|
|
2331
|
+
return escapeTextForBrowser(content);
|
|
2320
2332
|
}
|
|
2321
2333
|
}
|
|
2322
2334
|
return null;
|
|
@@ -2352,7 +2364,7 @@ function flattenOptionChildren(children) {
|
|
|
2352
2364
|
{
|
|
2353
2365
|
if (!didWarnInvalidOptionChildren) {
|
|
2354
2366
|
didWarnInvalidOptionChildren = true;
|
|
2355
|
-
warning_1
|
|
2367
|
+
warning_1(false, 'Only strings and numbers are supported as <option> children.');
|
|
2356
2368
|
}
|
|
2357
2369
|
}
|
|
2358
2370
|
}
|
|
@@ -2374,7 +2386,7 @@ function maskContext(type, context) {
|
|
|
2374
2386
|
|
|
2375
2387
|
function checkContextTypes(typeSpecs, values, location) {
|
|
2376
2388
|
{
|
|
2377
|
-
checkPropTypes_1
|
|
2389
|
+
checkPropTypes_1(typeSpecs, values, location, 'Component', getStackAddendum);
|
|
2378
2390
|
}
|
|
2379
2391
|
}
|
|
2380
2392
|
|
|
@@ -2437,7 +2449,7 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
|
|
|
2437
2449
|
|
|
2438
2450
|
function validateRenderResult(child, type) {
|
|
2439
2451
|
if (child === undefined) {
|
|
2440
|
-
invariant_1
|
|
2452
|
+
invariant_1(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', getComponentName(type) || 'Component');
|
|
2441
2453
|
}
|
|
2442
2454
|
}
|
|
2443
2455
|
|
|
@@ -2543,10 +2555,13 @@ function resolve(child, context) {
|
|
|
2543
2555
|
var childContext;
|
|
2544
2556
|
if (typeof inst.getChildContext === 'function') {
|
|
2545
2557
|
var childContextTypes = Component.childContextTypes;
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2558
|
+
if (typeof childContextTypes === 'object') {
|
|
2559
|
+
childContext = inst.getChildContext();
|
|
2560
|
+
for (var contextKey in childContext) {
|
|
2561
|
+
!(contextKey in childContextTypes) ? invariant_1(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
|
|
2562
|
+
}
|
|
2563
|
+
} else {
|
|
2564
|
+
warning_1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
|
2550
2565
|
}
|
|
2551
2566
|
}
|
|
2552
2567
|
if (childContext) {
|
|
@@ -2556,7 +2571,7 @@ function resolve(child, context) {
|
|
|
2556
2571
|
return { child: child, context: context };
|
|
2557
2572
|
}
|
|
2558
2573
|
|
|
2559
|
-
var ReactDOMServerRenderer
|
|
2574
|
+
var ReactDOMServerRenderer = function () {
|
|
2560
2575
|
function ReactDOMServerRenderer(children, makeStaticMarkup) {
|
|
2561
2576
|
_classCallCheck(this, ReactDOMServerRenderer);
|
|
2562
2577
|
|
|
@@ -2627,13 +2642,13 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2627
2642
|
return '';
|
|
2628
2643
|
}
|
|
2629
2644
|
if (this.makeStaticMarkup) {
|
|
2630
|
-
return
|
|
2645
|
+
return escapeTextForBrowser(text);
|
|
2631
2646
|
}
|
|
2632
2647
|
if (this.previousWasTextNode) {
|
|
2633
|
-
return '<!-- -->' +
|
|
2648
|
+
return '<!-- -->' + escapeTextForBrowser(text);
|
|
2634
2649
|
}
|
|
2635
2650
|
this.previousWasTextNode = true;
|
|
2636
|
-
return
|
|
2651
|
+
return escapeTextForBrowser(text);
|
|
2637
2652
|
} else {
|
|
2638
2653
|
var nextChild;
|
|
2639
2654
|
|
|
@@ -2692,7 +2707,7 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2692
2707
|
if (namespace === Namespaces.html) {
|
|
2693
2708
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
2694
2709
|
// allow <SVG> or <mATH>.
|
|
2695
|
-
warning_1
|
|
2710
|
+
warning_1(tag === element.type, '<%s /> is using uppercase HTML. Always use lowercase HTML tags ' + 'in React.', element.type);
|
|
2696
2711
|
}
|
|
2697
2712
|
}
|
|
2698
2713
|
|
|
@@ -2704,11 +2719,11 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2704
2719
|
ReactControlledValuePropTypes.checkPropTypes('input', props, getStackAddendum);
|
|
2705
2720
|
|
|
2706
2721
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
|
2707
|
-
warning_1
|
|
2722
|
+
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);
|
|
2708
2723
|
didWarnDefaultChecked = true;
|
|
2709
2724
|
}
|
|
2710
2725
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
|
2711
|
-
warning_1
|
|
2726
|
+
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);
|
|
2712
2727
|
didWarnDefaultInputValue = true;
|
|
2713
2728
|
}
|
|
2714
2729
|
}
|
|
@@ -2725,7 +2740,7 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2725
2740
|
{
|
|
2726
2741
|
ReactControlledValuePropTypes.checkPropTypes('textarea', props, getStackAddendum);
|
|
2727
2742
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
|
2728
|
-
warning_1
|
|
2743
|
+
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');
|
|
2729
2744
|
didWarnDefaultTextareaValue = true;
|
|
2730
2745
|
}
|
|
2731
2746
|
}
|
|
@@ -2737,11 +2752,11 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2737
2752
|
var textareaChildren = props.children;
|
|
2738
2753
|
if (textareaChildren != null) {
|
|
2739
2754
|
{
|
|
2740
|
-
warning_1
|
|
2755
|
+
warning_1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
|
2741
2756
|
}
|
|
2742
|
-
!(defaultValue == null) ? invariant_1
|
|
2757
|
+
!(defaultValue == null) ? invariant_1(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
|
|
2743
2758
|
if (Array.isArray(textareaChildren)) {
|
|
2744
|
-
!(textareaChildren.length <= 1) ? invariant_1
|
|
2759
|
+
!(textareaChildren.length <= 1) ? invariant_1(false, '<textarea> can only have at most one child.') : void 0;
|
|
2745
2760
|
textareaChildren = textareaChildren[0];
|
|
2746
2761
|
}
|
|
2747
2762
|
|
|
@@ -2768,14 +2783,14 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2768
2783
|
}
|
|
2769
2784
|
var isArray = Array.isArray(props[propName]);
|
|
2770
2785
|
if (props.multiple && !isArray) {
|
|
2771
|
-
warning_1
|
|
2786
|
+
warning_1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '');
|
|
2772
2787
|
} else if (!props.multiple && isArray) {
|
|
2773
|
-
warning_1
|
|
2788
|
+
warning_1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '');
|
|
2774
2789
|
}
|
|
2775
2790
|
}
|
|
2776
2791
|
|
|
2777
2792
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
|
2778
|
-
warning_1
|
|
2793
|
+
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');
|
|
2779
2794
|
didWarnDefaultSelectValue = true;
|
|
2780
2795
|
}
|
|
2781
2796
|
}
|
|
@@ -2877,7 +2892,7 @@ var ReactDOMServerRenderer$1 = function () {
|
|
|
2877
2892
|
* See https://reactjs.org/docs/react-dom-server.html#rendertostring
|
|
2878
2893
|
*/
|
|
2879
2894
|
function renderToString(element) {
|
|
2880
|
-
var renderer = new ReactDOMServerRenderer
|
|
2895
|
+
var renderer = new ReactDOMServerRenderer(element, false);
|
|
2881
2896
|
var markup = renderer.read(Infinity);
|
|
2882
2897
|
return markup;
|
|
2883
2898
|
}
|
|
@@ -2888,17 +2903,17 @@ function renderToString(element) {
|
|
|
2888
2903
|
* See https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup
|
|
2889
2904
|
*/
|
|
2890
2905
|
function renderToStaticMarkup(element) {
|
|
2891
|
-
var renderer = new ReactDOMServerRenderer
|
|
2906
|
+
var renderer = new ReactDOMServerRenderer(element, true);
|
|
2892
2907
|
var markup = renderer.read(Infinity);
|
|
2893
2908
|
return markup;
|
|
2894
2909
|
}
|
|
2895
2910
|
|
|
2896
2911
|
function renderToNodeStream() {
|
|
2897
|
-
invariant_1
|
|
2912
|
+
invariant_1(false, 'ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.');
|
|
2898
2913
|
}
|
|
2899
2914
|
|
|
2900
2915
|
function renderToStaticNodeStream() {
|
|
2901
|
-
invariant_1
|
|
2916
|
+
invariant_1(false, 'ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.');
|
|
2902
2917
|
}
|
|
2903
2918
|
|
|
2904
2919
|
// Note: when changing this, also consider https://github.com/facebook/react/issues/11526
|