react-dom 16.4.2 → 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.
@@ -1,4 +1,4 @@
1
- /** @license React v16.4.2
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,23 +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');
21
+
22
+ /**
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.
31
+ */
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
+ }
28
63
 
29
64
  // Relying on the `invariant()` implementation lets us
30
- // have preserve the format and params in the www builds.
65
+ // preserve the format and params in the www builds.
31
66
 
32
67
  // TODO: this is special because it gets imported during build.
33
68
 
34
- var ReactVersion = '16.4.2';
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
+ }
35
190
 
36
191
  /**
37
192
  * Forked from fbjs/warning:
@@ -72,7 +227,7 @@ var lowPriorityWarning = function () {};
72
227
 
73
228
  lowPriorityWarning = function (condition, format) {
74
229
  if (format === undefined) {
75
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
230
+ throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
76
231
  }
77
232
  if (!condition) {
78
233
  for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
@@ -86,14 +241,63 @@ var lowPriorityWarning = function () {};
86
241
 
87
242
  var lowPriorityWarning$1 = lowPriorityWarning;
88
243
 
89
- var describeComponentFrame = function (name, source, ownerName) {
90
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
91
- };
244
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
245
+
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
+ */
252
+
253
+ var warning = warningWithoutStack$1;
254
+
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
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
+ }
267
+
268
+ warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
269
+ };
270
+ }
92
271
 
93
- var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
272
+ var warning$1 = warning;
94
273
 
95
- var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
96
- var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
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
+ };
97
301
 
98
302
  // Exports ReactDOM.createRoot
99
303
 
@@ -125,21 +329,13 @@ var warnAboutDeprecatedLifecycles = false;
125
329
  // Gather advanced timing metrics for Profiler subtrees.
126
330
 
127
331
 
128
- // Only used in www builds.
332
+ // Track which interactions trigger each commit.
129
333
 
130
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
131
- // nor polyfill, then a plain number is used for performance.
132
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
133
334
 
335
+ // Only used in www builds.
336
+ var enableSuspenseServerRenderer = false;
134
337
 
135
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
136
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
137
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
138
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
139
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
140
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
141
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
142
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
338
+ // Only used in www builds.
143
339
 
144
340
  // A reserved attribute.
145
341
  // It is handled by React separately and shouldn't be written to the DOM.
@@ -200,7 +396,7 @@ function isAttributeNameSafe(attributeName) {
200
396
  }
201
397
  illegalAttributeNameCache[attributeName] = true;
202
398
  {
203
- warning(false, 'Invalid attribute name: `%s`', attributeName);
399
+ warning$1(false, 'Invalid attribute name: `%s`', attributeName);
204
400
  }
205
401
  return false;
206
402
  }
@@ -326,7 +522,7 @@ var properties = {};
326
522
  // In React, we let users pass `true` and `false` even though technically
327
523
  // these aren't boolean attributes (they are coerced to strings).
328
524
  // Since these are SVG attributes, their attribute names are case-sensitive.
329
- ['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(function (name) {
525
+ ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
330
526
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
331
527
  name, // attributeName
332
528
  null);
@@ -353,7 +549,7 @@ var properties = {};
353
549
  // disabled with `removeAttribute`. We have special logic for handling this.
354
550
  'multiple', 'muted', 'selected'].forEach(function (name) {
355
551
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
356
- name.toLowerCase(), // attributeName
552
+ name, // attributeName
357
553
  null);
358
554
  } // attributeNamespace
359
555
  );
@@ -362,7 +558,7 @@ var properties = {};
362
558
  // booleans, but can also accept a string value.
363
559
  ['capture', 'download'].forEach(function (name) {
364
560
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
365
- name.toLowerCase(), // attributeName
561
+ name, // attributeName
366
562
  null);
367
563
  } // attributeNamespace
368
564
  );
@@ -370,7 +566,7 @@ var properties = {};
370
566
  // These are HTML attributes that must be positive numbers.
371
567
  ['cols', 'rows', 'size', 'span'].forEach(function (name) {
372
568
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
373
- name.toLowerCase(), // attributeName
569
+ name, // attributeName
374
570
  null);
375
571
  } // attributeNamespace
376
572
  );
@@ -609,11 +805,15 @@ function getChildNamespace(parentNamespace, type) {
609
805
  return parentNamespace;
610
806
  }
611
807
 
808
+ var ReactDebugCurrentFrame$1 = null;
809
+
612
810
  var ReactControlledValuePropTypes = {
613
811
  checkPropTypes: null
614
812
  };
615
813
 
616
814
  {
815
+ ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
816
+
617
817
  var hasReadOnlyValue = {
618
818
  button: true,
619
819
  checkbox: true,
@@ -626,13 +826,13 @@ var ReactControlledValuePropTypes = {
626
826
 
627
827
  var propTypes = {
628
828
  value: function (props, propName, componentName) {
629
- if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
829
+ if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
630
830
  return null;
631
831
  }
632
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`.');
633
833
  },
634
834
  checked: function (props, propName, componentName) {
635
- if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
835
+ if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
636
836
  return null;
637
837
  }
638
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`.');
@@ -643,8 +843,8 @@ var ReactControlledValuePropTypes = {
643
843
  * Provide a linked `value` attribute for controlled forms. You should not use
644
844
  * this outside of the ReactDOM controlled form components.
645
845
  */
646
- ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) {
647
- checkPropTypes(propTypes, props, 'prop', tagName, getStack);
846
+ ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
847
+ checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
648
848
  };
649
849
  }
650
850
 
@@ -677,24 +877,31 @@ var voidElementTags = _assign({
677
877
  menuitem: true
678
878
  }, omittedCloseTags);
679
879
 
880
+ // TODO: We can remove this if we add invariantWithStack()
881
+ // or add stack by default to invariants where possible.
680
882
  var HTML = '__html';
681
883
 
682
- function assertValidProps(tag, props, getStack) {
884
+ var ReactDebugCurrentFrame$2 = null;
885
+ {
886
+ ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
887
+ }
888
+
889
+ function assertValidProps(tag, props) {
683
890
  if (!props) {
684
891
  return;
685
892
  }
686
893
  // Note the use of `==` which checks for null or undefined.
687
894
  if (voidElementTags[tag]) {
688
- !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getStack()) : void 0;
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;
689
896
  }
690
897
  if (props.dangerouslySetInnerHTML != null) {
691
898
  !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
692
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;
693
900
  }
694
901
  {
695
- !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning(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.%s', getStack()) : void 0;
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;
696
903
  }
697
- !(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', getStack()) : void 0;
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;
698
905
  }
699
906
 
700
907
  /**
@@ -716,6 +923,7 @@ var isUnitlessNumber = {
716
923
  flexShrink: true,
717
924
  flexNegative: true,
718
925
  flexOrder: true,
926
+ gridArea: true,
719
927
  gridRow: true,
720
928
  gridRowEnd: true,
721
929
  gridRowSpan: true,
@@ -802,6 +1010,26 @@ function dangerousStyleValue(name, value, isCustomProperty) {
802
1010
  return ('' + value).trim();
803
1011
  }
804
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
+
805
1033
  function isCustomComponent(tagName, props) {
806
1034
  if (tagName.indexOf('-') === -1) {
807
1035
  return typeof props.is === 'string';
@@ -825,11 +1053,13 @@ function isCustomComponent(tagName, props) {
825
1053
  }
826
1054
  }
827
1055
 
828
- var warnValidStyle = emptyFunction;
1056
+ var warnValidStyle = function () {};
829
1057
 
830
1058
  {
831
1059
  // 'msTransform' is correct, but the other prefixes should be capitalized
832
1060
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
1061
+ var msPattern$1 = /^-ms-/;
1062
+ var hyphenPattern = /-(.)/g;
833
1063
 
834
1064
  // style values shouldn't contain a semicolon
835
1065
  var badStyleValueWithSemicolonPattern = /;\s*$/;
@@ -839,65 +1069,75 @@ var warnValidStyle = emptyFunction;
839
1069
  var warnedForNaNValue = false;
840
1070
  var warnedForInfinityValue = false;
841
1071
 
842
- var warnHyphenatedStyleName = function (name, getStack) {
1072
+ var camelize = function (string) {
1073
+ return string.replace(hyphenPattern, function (_, character) {
1074
+ return character.toUpperCase();
1075
+ });
1076
+ };
1077
+
1078
+ var warnHyphenatedStyleName = function (name) {
843
1079
  if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
844
1080
  return;
845
1081
  }
846
1082
 
847
1083
  warnedStyleNames[name] = true;
848
- warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), getStack());
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-')));
849
1089
  };
850
1090
 
851
- var warnBadVendoredStyleName = function (name, getStack) {
1091
+ var warnBadVendoredStyleName = function (name) {
852
1092
  if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
853
1093
  return;
854
1094
  }
855
1095
 
856
1096
  warnedStyleNames[name] = true;
857
- warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), getStack());
1097
+ warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
858
1098
  };
859
1099
 
860
- var warnStyleValueWithSemicolon = function (name, value, getStack) {
1100
+ var warnStyleValueWithSemicolon = function (name, value) {
861
1101
  if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
862
1102
  return;
863
1103
  }
864
1104
 
865
1105
  warnedStyleValues[value] = true;
866
- warning(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.%s', name, value.replace(badStyleValueWithSemicolonPattern, ''), getStack());
1106
+ warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
867
1107
  };
868
1108
 
869
- var warnStyleValueIsNaN = function (name, value, getStack) {
1109
+ var warnStyleValueIsNaN = function (name, value) {
870
1110
  if (warnedForNaNValue) {
871
1111
  return;
872
1112
  }
873
1113
 
874
1114
  warnedForNaNValue = true;
875
- warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, getStack());
1115
+ warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
876
1116
  };
877
1117
 
878
- var warnStyleValueIsInfinity = function (name, value, getStack) {
1118
+ var warnStyleValueIsInfinity = function (name, value) {
879
1119
  if (warnedForInfinityValue) {
880
1120
  return;
881
1121
  }
882
1122
 
883
1123
  warnedForInfinityValue = true;
884
- warning(false, '`Infinity` is an invalid value for the `%s` css style property.%s', name, getStack());
1124
+ warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
885
1125
  };
886
1126
 
887
- warnValidStyle = function (name, value, getStack) {
1127
+ warnValidStyle = function (name, value) {
888
1128
  if (name.indexOf('-') > -1) {
889
- warnHyphenatedStyleName(name, getStack);
1129
+ warnHyphenatedStyleName(name);
890
1130
  } else if (badVendoredStyleNamePattern.test(name)) {
891
- warnBadVendoredStyleName(name, getStack);
1131
+ warnBadVendoredStyleName(name);
892
1132
  } else if (badStyleValueWithSemicolonPattern.test(value)) {
893
- warnStyleValueWithSemicolon(name, value, getStack);
1133
+ warnStyleValueWithSemicolon(name, value);
894
1134
  }
895
1135
 
896
1136
  if (typeof value === 'number') {
897
1137
  if (isNaN(value)) {
898
- warnStyleValueIsNaN(name, value, getStack);
1138
+ warnStyleValueIsNaN(name, value);
899
1139
  } else if (!isFinite(value)) {
900
- warnStyleValueIsInfinity(name, value, getStack);
1140
+ warnStyleValueIsInfinity(name, value);
901
1141
  }
902
1142
  }
903
1143
  };
@@ -966,11 +1206,6 @@ var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
966
1206
 
967
1207
  var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
968
1208
 
969
- function getStackAddendum$1() {
970
- var stack = ReactDebugCurrentFrame.getStackAddendum();
971
- return stack != null ? stack : '';
972
- }
973
-
974
1209
  function validateProperty(tagName, name) {
975
1210
  if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
976
1211
  return true;
@@ -983,13 +1218,13 @@ function validateProperty(tagName, name) {
983
1218
  // If this is an aria-* attribute, but is not listed in the known DOM
984
1219
  // DOM properties, then it is an invalid aria-* attribute.
985
1220
  if (correctName == null) {
986
- warning(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.%s', name, getStackAddendum$1());
1221
+ warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
987
1222
  warnedProperties[name] = true;
988
1223
  return true;
989
1224
  }
990
1225
  // aria-* attributes should be lowercase; suggest the lowercase version.
991
1226
  if (name !== correctName) {
992
- warning(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?%s', name, correctName, getStackAddendum$1());
1227
+ warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
993
1228
  warnedProperties[name] = true;
994
1229
  return true;
995
1230
  }
@@ -1007,7 +1242,7 @@ function validateProperty(tagName, name) {
1007
1242
  }
1008
1243
  // aria-* attributes should be lowercase; suggest the lowercase version.
1009
1244
  if (name !== standardName) {
1010
- warning(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$1());
1245
+ warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
1011
1246
  warnedProperties[name] = true;
1012
1247
  return true;
1013
1248
  }
@@ -1031,9 +1266,9 @@ function warnInvalidARIAProps(type, props) {
1031
1266
  }).join(', ');
1032
1267
 
1033
1268
  if (invalidProps.length === 1) {
1034
- warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$1());
1269
+ warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
1035
1270
  } else if (invalidProps.length > 1) {
1036
- warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$1());
1271
+ warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
1037
1272
  }
1038
1273
  }
1039
1274
 
@@ -1046,11 +1281,6 @@ function validateProperties(type, props) {
1046
1281
 
1047
1282
  var didWarnValueNull = false;
1048
1283
 
1049
- function getStackAddendum$2() {
1050
- var stack = ReactDebugCurrentFrame.getStackAddendum();
1051
- return stack != null ? stack : '';
1052
- }
1053
-
1054
1284
  function validateProperties$1(type, props) {
1055
1285
  if (type !== 'input' && type !== 'textarea' && type !== 'select') {
1056
1286
  return;
@@ -1059,9 +1289,9 @@ function validateProperties$1(type, props) {
1059
1289
  if (props != null && props.value === null && !didWarnValueNull) {
1060
1290
  didWarnValueNull = true;
1061
1291
  if (type === 'select' && props.multiple) {
1062
- 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.%s', type, getStackAddendum$2());
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);
1063
1293
  } else {
1064
- warning(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());
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);
1065
1295
  }
1066
1296
  }
1067
1297
  }
@@ -1612,11 +1842,6 @@ var possibleStandardNames = {
1612
1842
  zoomandpan: 'zoomAndPan'
1613
1843
  };
1614
1844
 
1615
- function getStackAddendum$3() {
1616
- var stack = ReactDebugCurrentFrame.getStackAddendum();
1617
- return stack != null ? stack : '';
1618
- }
1619
-
1620
1845
  var validateProperty$1 = function () {};
1621
1846
 
1622
1847
  {
@@ -1634,7 +1859,7 @@ var validateProperty$1 = function () {};
1634
1859
 
1635
1860
  var lowerCasedName = name.toLowerCase();
1636
1861
  if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
1637
- 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.');
1638
1863
  warnedProperties$1[name] = true;
1639
1864
  return true;
1640
1865
  }
@@ -1646,12 +1871,12 @@ var validateProperty$1 = function () {};
1646
1871
  }
1647
1872
  var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
1648
1873
  if (registrationName != null) {
1649
- warning(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$3());
1874
+ warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
1650
1875
  warnedProperties$1[name] = true;
1651
1876
  return true;
1652
1877
  }
1653
1878
  if (EVENT_NAME_REGEX.test(name)) {
1654
- warning(false, 'Unknown event handler property `%s`. It will be ignored.%s', name, getStackAddendum$3());
1879
+ warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
1655
1880
  warnedProperties$1[name] = true;
1656
1881
  return true;
1657
1882
  }
@@ -1660,7 +1885,7 @@ var validateProperty$1 = function () {};
1660
1885
  // So we can't tell if the event name is correct for sure, but we can filter
1661
1886
  // out known bad ones like `onclick`. We can't suggest a specific replacement though.
1662
1887
  if (INVALID_EVENT_NAME_REGEX.test(name)) {
1663
- warning(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.%s', name, getStackAddendum$3());
1888
+ warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
1664
1889
  }
1665
1890
  warnedProperties$1[name] = true;
1666
1891
  return true;
@@ -1672,25 +1897,25 @@ var validateProperty$1 = function () {};
1672
1897
  }
1673
1898
 
1674
1899
  if (lowerCasedName === 'innerhtml') {
1675
- 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`.');
1676
1901
  warnedProperties$1[name] = true;
1677
1902
  return true;
1678
1903
  }
1679
1904
 
1680
1905
  if (lowerCasedName === 'aria') {
1681
- 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.');
1682
1907
  warnedProperties$1[name] = true;
1683
1908
  return true;
1684
1909
  }
1685
1910
 
1686
1911
  if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
1687
- warning(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum$3());
1912
+ warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
1688
1913
  warnedProperties$1[name] = true;
1689
1914
  return true;
1690
1915
  }
1691
1916
 
1692
1917
  if (typeof value === 'number' && isNaN(value)) {
1693
- warning(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum$3());
1918
+ warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
1694
1919
  warnedProperties$1[name] = true;
1695
1920
  return true;
1696
1921
  }
@@ -1702,23 +1927,23 @@ var validateProperty$1 = function () {};
1702
1927
  if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
1703
1928
  var standardName = possibleStandardNames[lowerCasedName];
1704
1929
  if (standardName !== name) {
1705
- warning(false, 'Invalid DOM property `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$3());
1930
+ warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
1706
1931
  warnedProperties$1[name] = true;
1707
1932
  return true;
1708
1933
  }
1709
1934
  } else if (!isReserved && name !== lowerCasedName) {
1710
1935
  // Unknown attributes should have lowercase casing since that's how they
1711
1936
  // will be cased anyway with server rendering.
1712
- 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.%s', name, lowerCasedName, getStackAddendum$3());
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);
1713
1938
  warnedProperties$1[name] = true;
1714
1939
  return true;
1715
1940
  }
1716
1941
 
1717
1942
  if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
1718
1943
  if (value) {
1719
- 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()}.%s', value, name, name, value, name, getStackAddendum$3());
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);
1720
1945
  } else {
1721
- 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.%s', value, name, name, value, name, name, name, getStackAddendum$3());
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);
1722
1947
  }
1723
1948
  warnedProperties$1[name] = true;
1724
1949
  return true;
@@ -1736,6 +1961,13 @@ var validateProperty$1 = function () {};
1736
1961
  return false;
1737
1962
  }
1738
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
+
1739
1971
  return true;
1740
1972
  };
1741
1973
  }
@@ -1753,9 +1985,9 @@ var warnUnknownProperties = function (type, props, canUseEventSystem) {
1753
1985
  return '`' + prop + '`';
1754
1986
  }).join(', ');
1755
1987
  if (unknownProps.length === 1) {
1756
- 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%s', unknownPropString, type, getStackAddendum$3());
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);
1757
1989
  } else if (unknownProps.length > 1) {
1758
- 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%s', unknownPropString, type, getStackAddendum$3());
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);
1759
1991
  }
1760
1992
  };
1761
1993
 
@@ -1772,18 +2004,29 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
1772
2004
 
1773
2005
  var toArray = React.Children.toArray;
1774
2006
 
1775
- var currentDebugStack = void 0;
1776
- var currentDebugElementStack = void 0;
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 = [];
1777
2012
 
1778
- var getStackAddendum = emptyFunction.thatReturns('');
1779
- var describeStackFrame = emptyFunction.thatReturns('');
2013
+ var ReactDebugCurrentFrame = void 0;
2014
+ var prevGetCurrentStackImpl = null;
2015
+ var getCurrentServerStackImpl = function () {
2016
+ return '';
2017
+ };
2018
+ var describeStackFrame = function (element) {
2019
+ return '';
2020
+ };
1780
2021
 
1781
2022
  var validatePropertiesInDevelopment = function (type, props) {};
1782
- var setCurrentDebugStack = function (stack) {};
2023
+ var pushCurrentDebugStack = function (stack) {};
1783
2024
  var pushElementToDebugStack = function (element) {};
1784
- var resetCurrentDebugStack = function () {};
2025
+ var popCurrentDebugStack = function () {};
1785
2026
 
1786
2027
  {
2028
+ ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
2029
+
1787
2030
  validatePropertiesInDevelopment = function (type, props) {
1788
2031
  validateProperties(type, props);
1789
2032
  validateProperties$1(type, props);
@@ -1798,34 +2041,55 @@ var resetCurrentDebugStack = function () {};
1798
2041
  return describeComponentFrame(name, source, ownerName);
1799
2042
  };
1800
2043
 
1801
- currentDebugStack = null;
1802
- currentDebugElementStack = null;
1803
- setCurrentDebugStack = function (stack) {
1804
- var frame = stack[stack.length - 1];
1805
- currentDebugElementStack = frame.debugElementStack;
1806
- // We are about to enter a new composite stack, reset the array.
1807
- currentDebugElementStack.length = 0;
1808
- currentDebugStack = stack;
1809
- ReactDebugCurrentFrame.getCurrentStack = getStackAddendum;
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
+ }
1810
2053
  };
2054
+
1811
2055
  pushElementToDebugStack = function (element) {
1812
- if (currentDebugElementStack !== null) {
1813
- currentDebugElementStack.push(element);
1814
- }
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.
1815
2065
  };
1816
- resetCurrentDebugStack = function () {
1817
- currentDebugElementStack = null;
1818
- currentDebugStack = null;
1819
- ReactDebugCurrentFrame.getCurrentStack = null;
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
+ }
1820
2076
  };
1821
- getStackAddendum = function () {
1822
- if (currentDebugStack === null) {
2077
+
2078
+ getCurrentServerStackImpl = function () {
2079
+ if (currentDebugStacks.length === 0) {
2080
+ // Nothing is currently rendering.
1823
2081
  return '';
1824
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];
1825
2086
  var stack = '';
1826
- var debugStack = currentDebugStack;
1827
- for (var i = debugStack.length - 1; i >= 0; i--) {
1828
- var frame = debugStack[i];
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()`.
1829
2093
  var _debugElementStack = frame.debugElementStack;
1830
2094
  for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) {
1831
2095
  stack += describeStackFrame(_debugElementStack[ii]);
@@ -1852,10 +2116,6 @@ var newlineEatingTags = {
1852
2116
  textarea: true
1853
2117
  };
1854
2118
 
1855
- function getComponentName(type) {
1856
- return typeof type === 'string' ? type : typeof type === 'function' ? type.displayName || type.name : null;
1857
- }
1858
-
1859
2119
  // We accept any tag to be rendered but since this gets injected into arbitrary
1860
2120
  // HTML, we want to make sure that it's a safe tag.
1861
2121
  // http://www.w3.org/TR/REC-xml/#NT-Name
@@ -1868,9 +2128,15 @@ function validateDangerousTag(tag) {
1868
2128
  }
1869
2129
  }
1870
2130
 
1871
- var processStyleName = memoizeStringOnly(function (styleName) {
1872
- return hyphenateStyleName(styleName);
1873
- });
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
+ };
1874
2140
 
1875
2141
  function createMarkupForStyles(styles) {
1876
2142
  var serialized = '';
@@ -1883,7 +2149,7 @@ function createMarkupForStyles(styles) {
1883
2149
  var styleValue = styles[styleName];
1884
2150
  {
1885
2151
  if (!isCustomProperty) {
1886
- warnValidStyle$1(styleName, styleValue, getStackAddendum);
2152
+ warnValidStyle$1(styleName, styleValue);
1887
2153
  }
1888
2154
  }
1889
2155
  if (styleValue != null) {
@@ -1905,7 +2171,7 @@ function warnNoop(publicInstance, callerName) {
1905
2171
  return;
1906
2172
  }
1907
2173
 
1908
- warning(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);
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);
1909
2175
  didWarnAboutNoopUpdateForComponent[warningKey] = true;
1910
2176
  }
1911
2177
  }
@@ -1946,6 +2212,9 @@ function flattenTopLevelChildren(children) {
1946
2212
  }
1947
2213
 
1948
2214
  function flattenOptionChildren(children) {
2215
+ if (children === undefined || children === null) {
2216
+ return children;
2217
+ }
1949
2218
  var content = '';
1950
2219
  // Flatten children and warn if they aren't strings or numbers;
1951
2220
  // invalid types are ignored.
@@ -1953,20 +2222,22 @@ function flattenOptionChildren(children) {
1953
2222
  if (child == null) {
1954
2223
  return;
1955
2224
  }
1956
- if (typeof child === 'string' || typeof child === 'number') {
1957
- content += child;
1958
- } else {
1959
- {
1960
- if (!didWarnInvalidOptionChildren) {
1961
- didWarnInvalidOptionChildren = true;
1962
- warning(false, 'Only strings and numbers are supported as <option> children.');
1963
- }
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.');
1964
2230
  }
1965
2231
  }
1966
2232
  });
1967
2233
  return content;
1968
2234
  }
1969
2235
 
2236
+ var emptyObject = {};
2237
+ {
2238
+ Object.freeze(emptyObject);
2239
+ }
2240
+
1970
2241
  function maskContext(type, context) {
1971
2242
  var contextTypes = type.contextTypes;
1972
2243
  if (!contextTypes) {
@@ -1981,7 +2252,7 @@ function maskContext(type, context) {
1981
2252
 
1982
2253
  function checkContextTypes(typeSpecs, values, location) {
1983
2254
  {
1984
- checkPropTypes(typeSpecs, values, location, 'Component', getStackAddendum);
2255
+ checkPropTypes(typeSpecs, values, location, 'Component', getCurrentServerStackImpl);
1985
2256
  }
1986
2257
  }
1987
2258
 
@@ -2101,7 +2372,7 @@ function resolve(child, context) {
2101
2372
  if (inst.state === null || inst.state === undefined) {
2102
2373
  var componentName = getComponentName(Component) || 'Unknown';
2103
2374
  if (!didWarnAboutUninitializedState[componentName]) {
2104
- warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, inst.state === null ? 'null' : 'undefined');
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);
2105
2376
  didWarnAboutUninitializedState[componentName] = true;
2106
2377
  }
2107
2378
  }
@@ -2113,7 +2384,7 @@ function resolve(child, context) {
2113
2384
  if (partialState === undefined) {
2114
2385
  var _componentName = getComponentName(Component) || 'Unknown';
2115
2386
  if (!didWarnAboutUndefinedDerivedState[_componentName]) {
2116
- warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
2387
+ warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
2117
2388
  didWarnAboutUndefinedDerivedState[_componentName] = true;
2118
2389
  }
2119
2390
  }
@@ -2129,7 +2400,7 @@ function resolve(child, context) {
2129
2400
  var _componentName2 = getComponentName(Component) || 'Unknown';
2130
2401
 
2131
2402
  if (!didWarnAboutBadClass[_componentName2]) {
2132
- warning(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);
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);
2133
2404
  didWarnAboutBadClass[_componentName2] = true;
2134
2405
  }
2135
2406
  }
@@ -2223,7 +2494,7 @@ function resolve(child, context) {
2223
2494
  !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
2224
2495
  }
2225
2496
  } else {
2226
- warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
2497
+ warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
2227
2498
  }
2228
2499
  }
2229
2500
  if (childContext) {
@@ -2302,7 +2573,7 @@ var ReactDOMServerRenderer = function () {
2302
2573
  ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
2303
2574
  var index = this.contextIndex;
2304
2575
  {
2305
- !(index > -1 && provider === this.contextProviderStack[index]) ? warning(false, 'Unexpected pop.') : void 0;
2576
+ !(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
2306
2577
  }
2307
2578
 
2308
2579
  var context = this.contextStack[index];
@@ -2351,12 +2622,15 @@ var ReactDOMServerRenderer = function () {
2351
2622
  }
2352
2623
  var child = frame.children[frame.childIndex++];
2353
2624
  {
2354
- setCurrentDebugStack(this.stack);
2355
- }
2356
- out += this.render(child, frame.context, frame.domNamespace);
2357
- {
2358
- // TODO: Handle reentrant server render calls. This doesn't.
2359
- resetCurrentDebugStack();
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
+ }
2360
2634
  }
2361
2635
  }
2362
2636
  return out;
@@ -2438,6 +2712,27 @@ var ReactDOMServerRenderer = function () {
2438
2712
  this.stack.push(_frame);
2439
2713
  return '';
2440
2714
  }
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
+ }
2441
2736
  // eslint-disable-next-line-no-fallthrough
2442
2737
  default:
2443
2738
  break;
@@ -2447,41 +2742,41 @@ var ReactDOMServerRenderer = function () {
2447
2742
  case REACT_FORWARD_REF_TYPE:
2448
2743
  {
2449
2744
  var element = nextChild;
2450
- var _nextChildren2 = toArray(elementType.render(element.props, element.ref));
2451
- var _frame2 = {
2745
+ var _nextChildren3 = toArray(elementType.render(element.props, element.ref));
2746
+ var _frame3 = {
2452
2747
  type: null,
2453
2748
  domNamespace: parentNamespace,
2454
- children: _nextChildren2,
2749
+ children: _nextChildren3,
2455
2750
  childIndex: 0,
2456
2751
  context: context,
2457
2752
  footer: ''
2458
2753
  };
2459
2754
  {
2460
- _frame2.debugElementStack = [];
2755
+ _frame3.debugElementStack = [];
2461
2756
  }
2462
- this.stack.push(_frame2);
2757
+ this.stack.push(_frame3);
2463
2758
  return '';
2464
2759
  }
2465
2760
  case REACT_PROVIDER_TYPE:
2466
2761
  {
2467
2762
  var provider = nextChild;
2468
2763
  var nextProps = provider.props;
2469
- var _nextChildren3 = toArray(nextProps.children);
2470
- var _frame3 = {
2764
+ var _nextChildren4 = toArray(nextProps.children);
2765
+ var _frame4 = {
2471
2766
  type: provider,
2472
2767
  domNamespace: parentNamespace,
2473
- children: _nextChildren3,
2768
+ children: _nextChildren4,
2474
2769
  childIndex: 0,
2475
2770
  context: context,
2476
2771
  footer: ''
2477
2772
  };
2478
2773
  {
2479
- _frame3.debugElementStack = [];
2774
+ _frame4.debugElementStack = [];
2480
2775
  }
2481
2776
 
2482
2777
  this.pushProvider(provider);
2483
2778
 
2484
- this.stack.push(_frame3);
2779
+ this.stack.push(_frame4);
2485
2780
  return '';
2486
2781
  }
2487
2782
  case REACT_CONTEXT_TYPE:
@@ -2490,19 +2785,19 @@ var ReactDOMServerRenderer = function () {
2490
2785
  var _nextProps = consumer.props;
2491
2786
  var nextValue = consumer.type._currentValue;
2492
2787
 
2493
- var _nextChildren4 = toArray(_nextProps.children(nextValue));
2494
- var _frame4 = {
2788
+ var _nextChildren5 = toArray(_nextProps.children(nextValue));
2789
+ var _frame5 = {
2495
2790
  type: nextChild,
2496
2791
  domNamespace: parentNamespace,
2497
- children: _nextChildren4,
2792
+ children: _nextChildren5,
2498
2793
  childIndex: 0,
2499
2794
  context: context,
2500
2795
  footer: ''
2501
2796
  };
2502
2797
  {
2503
- _frame4.debugElementStack = [];
2798
+ _frame5.debugElementStack = [];
2504
2799
  }
2505
- this.stack.push(_frame4);
2800
+ this.stack.push(_frame5);
2506
2801
  return '';
2507
2802
  }
2508
2803
  default:
@@ -2537,7 +2832,7 @@ var ReactDOMServerRenderer = function () {
2537
2832
  if (namespace === Namespaces.html) {
2538
2833
  // Should this check be gated by parent namespace? Not sure we want to
2539
2834
  // allow <SVG> or <mATH>.
2540
- !(tag === element.type) ? warning(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
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;
2541
2836
  }
2542
2837
  }
2543
2838
 
@@ -2546,14 +2841,14 @@ var ReactDOMServerRenderer = function () {
2546
2841
  var props = element.props;
2547
2842
  if (tag === 'input') {
2548
2843
  {
2549
- ReactControlledValuePropTypes.checkPropTypes('input', props, getStackAddendum);
2844
+ ReactControlledValuePropTypes.checkPropTypes('input', props);
2550
2845
 
2551
2846
  if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
2552
- 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);
2553
2848
  didWarnDefaultChecked = true;
2554
2849
  }
2555
2850
  if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
2556
- 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);
2557
2852
  didWarnDefaultInputValue = true;
2558
2853
  }
2559
2854
  }
@@ -2568,9 +2863,9 @@ var ReactDOMServerRenderer = function () {
2568
2863
  });
2569
2864
  } else if (tag === 'textarea') {
2570
2865
  {
2571
- ReactControlledValuePropTypes.checkPropTypes('textarea', props, getStackAddendum);
2866
+ ReactControlledValuePropTypes.checkPropTypes('textarea', props);
2572
2867
  if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
2573
- 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');
2574
2869
  didWarnDefaultTextareaValue = true;
2575
2870
  }
2576
2871
  }
@@ -2582,7 +2877,7 @@ var ReactDOMServerRenderer = function () {
2582
2877
  var textareaChildren = props.children;
2583
2878
  if (textareaChildren != null) {
2584
2879
  {
2585
- 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>.');
2586
2881
  }
2587
2882
  !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
2588
2883
  if (Array.isArray(textareaChildren)) {
@@ -2604,7 +2899,7 @@ var ReactDOMServerRenderer = function () {
2604
2899
  });
2605
2900
  } else if (tag === 'select') {
2606
2901
  {
2607
- ReactControlledValuePropTypes.checkPropTypes('select', props, getStackAddendum);
2902
+ ReactControlledValuePropTypes.checkPropTypes('select', props);
2608
2903
 
2609
2904
  for (var i = 0; i < valuePropNames.length; i++) {
2610
2905
  var propName = valuePropNames[i];
@@ -2613,16 +2908,14 @@ var ReactDOMServerRenderer = function () {
2613
2908
  }
2614
2909
  var isArray = Array.isArray(props[propName]);
2615
2910
  if (props.multiple && !isArray) {
2616
- warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '' // getDeclarationErrorAddendum(),
2617
- );
2911
+ warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
2618
2912
  } else if (!props.multiple && isArray) {
2619
- warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '' // getDeclarationErrorAddendum(),
2620
- );
2913
+ warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
2621
2914
  }
2622
2915
  }
2623
2916
 
2624
2917
  if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
2625
- 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');
2626
2919
  didWarnDefaultSelectValue = true;
2627
2920
  }
2628
2921
  }
@@ -2668,7 +2961,7 @@ var ReactDOMServerRenderer = function () {
2668
2961
  validatePropertiesInDevelopment(tag, props);
2669
2962
  }
2670
2963
 
2671
- assertValidProps(tag, props, getStackAddendum);
2964
+ assertValidProps(tag, props);
2672
2965
 
2673
2966
  var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
2674
2967
  var footer = '';
@@ -2765,7 +3058,7 @@ var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || Rea
2765
3058
 
2766
3059
  // TODO: decide on the top-level export form.
2767
3060
  // This is hacky but makes it work with both Rollup and Jest
2768
- var server_browser = ReactDOMServer.default ? ReactDOMServer.default : ReactDOMServer;
3061
+ var server_browser = ReactDOMServer.default || ReactDOMServer;
2769
3062
 
2770
3063
  module.exports = server_browser;
2771
3064
  })();