react-dom 16.8.5 → 16.9.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.
Files changed (34) hide show
  1. package/build-info.json +5 -5
  2. package/cjs/react-dom-server.browser.development.js +473 -136
  3. package/cjs/react-dom-server.browser.production.min.js +45 -42
  4. package/cjs/react-dom-server.node.development.js +456 -131
  5. package/cjs/react-dom-server.node.production.min.js +46 -44
  6. package/cjs/react-dom-test-utils.development.js +328 -82
  7. package/cjs/react-dom-test-utils.production.min.js +26 -23
  8. package/cjs/react-dom-unstable-fizz.browser.development.js +9 -1
  9. package/cjs/react-dom-unstable-fizz.browser.production.min.js +1 -1
  10. package/cjs/react-dom-unstable-fizz.node.development.js +9 -1
  11. package/cjs/react-dom-unstable-fizz.node.production.min.js +1 -1
  12. package/cjs/react-dom-unstable-native-dependencies.development.js +67 -44
  13. package/cjs/react-dom-unstable-native-dependencies.production.min.js +20 -21
  14. package/cjs/react-dom.development.js +15465 -11493
  15. package/cjs/react-dom.production.min.js +266 -257
  16. package/cjs/react-dom.profiling.min.js +272 -263
  17. package/package.json +2 -2
  18. package/umd/react-dom-server.browser.development.js +473 -136
  19. package/umd/react-dom-server.browser.production.min.js +38 -37
  20. package/umd/react-dom-test-utils.development.js +349 -82
  21. package/umd/react-dom-test-utils.production.min.js +23 -22
  22. package/umd/react-dom-unstable-fizz.browser.development.js +9 -1
  23. package/umd/react-dom-unstable-fizz.browser.production.min.js +1 -1
  24. package/umd/react-dom-unstable-native-dependencies.development.js +67 -44
  25. package/umd/react-dom-unstable-native-dependencies.production.min.js +21 -22
  26. package/umd/react-dom.development.js +12006 -8031
  27. package/umd/react-dom.production.min.js +220 -209
  28. package/umd/react-dom.profiling.min.js +227 -214
  29. package/cjs/react-dom-unstable-fire.development.js +0 -21252
  30. package/cjs/react-dom-unstable-fire.production.min.js +0 -269
  31. package/cjs/react-dom-unstable-fire.profiling.min.js +0 -278
  32. package/umd/react-dom-unstable-fire.development.js +0 -21387
  33. package/umd/react-dom-unstable-fire.production.min.js +0 -220
  34. package/umd/react-dom-unstable-fire.profiling.min.js +0 -225
@@ -1,4 +1,4 @@
1
- /** @license React v16.8.5
1
+ /** @license React v16.9.0
2
2
  * react-dom-server.browser.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -19,6 +19,23 @@ var _assign = require('object-assign');
19
19
  var React = require('react');
20
20
  var checkPropTypes = require('prop-types/checkPropTypes');
21
21
 
22
+ // Do not require this module directly! Use normal `invariant` calls with
23
+ // template literal strings. The messages will be converted to ReactError during
24
+ // build, and in production they will be minified.
25
+
26
+ // Do not require this module directly! Use normal `invariant` calls with
27
+ // template literal strings. The messages will be converted to ReactError during
28
+ // build, and in production they will be minified.
29
+
30
+ function ReactError(error) {
31
+ error.name = 'Invariant Violation';
32
+ return error;
33
+ }
34
+
35
+ // TODO: this is special because it gets imported during build.
36
+
37
+ var ReactVersion = '16.9.0';
38
+
22
39
  /**
23
40
  * Use invariant() to assert state which your program assumes to be true.
24
41
  *
@@ -30,44 +47,6 @@ var checkPropTypes = require('prop-types/checkPropTypes');
30
47
  * will remain to ensure logic does not differ in production.
31
48
  */
32
49
 
33
- var validateFormat = function () {};
34
-
35
- {
36
- validateFormat = function (format) {
37
- if (format === undefined) {
38
- throw new Error('invariant requires an error message argument');
39
- }
40
- };
41
- }
42
-
43
- function invariant(condition, format, a, b, c, d, e, f) {
44
- validateFormat(format);
45
-
46
- if (!condition) {
47
- var error = void 0;
48
- if (format === undefined) {
49
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
50
- } else {
51
- var args = [a, b, c, d, e, f];
52
- var argIndex = 0;
53
- error = new Error(format.replace(/%s/g, function () {
54
- return args[argIndex++];
55
- }));
56
- error.name = 'Invariant Violation';
57
- }
58
-
59
- error.framesToPop = 1; // we don't care about invariant's own frame
60
- throw error;
61
- }
62
- }
63
-
64
- // Relying on the `invariant()` implementation lets us
65
- // preserve the format and params in the www builds.
66
-
67
- // TODO: this is special because it gets imported during build.
68
-
69
- var ReactVersion = '16.8.5';
70
-
71
50
  /**
72
51
  * Similar to invariant but only logs a warning if the condition is not met.
73
52
  * This can be used to log issues in development environments in critical
@@ -129,12 +108,16 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
129
108
  var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
130
109
  var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
131
110
  var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
111
+ // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
112
+ // (unstable) APIs that have been removed. Can we remove the symbols?
132
113
 
133
114
  var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
134
115
  var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
135
116
  var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
117
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
136
118
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
137
119
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
120
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
138
121
 
139
122
  var Resolved = 1;
140
123
 
@@ -165,8 +148,6 @@ function getComponentName(type) {
165
148
  return type;
166
149
  }
167
150
  switch (type) {
168
- case REACT_CONCURRENT_MODE_TYPE:
169
- return 'ConcurrentMode';
170
151
  case REACT_FRAGMENT_TYPE:
171
152
  return 'Fragment';
172
153
  case REACT_PORTAL_TYPE:
@@ -177,6 +158,8 @@ function getComponentName(type) {
177
158
  return 'StrictMode';
178
159
  case REACT_SUSPENSE_TYPE:
179
160
  return 'Suspense';
161
+ case REACT_SUSPENSE_LIST_TYPE:
162
+ return 'SuspenseList';
180
163
  }
181
164
  if (typeof type === 'object') {
182
165
  switch (type.$$typeof) {
@@ -195,6 +178,7 @@ function getComponentName(type) {
195
178
  if (resolvedThenable) {
196
179
  return getComponentName(resolvedThenable);
197
180
  }
181
+ break;
198
182
  }
199
183
  }
200
184
  }
@@ -264,6 +248,11 @@ if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
264
248
  current: null
265
249
  };
266
250
  }
251
+ if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
252
+ ReactSharedInternals.ReactCurrentBatchConfig = {
253
+ suspense: null
254
+ };
255
+ }
267
256
 
268
257
  /**
269
258
  * Similar to invariant but only logs a warning if the condition is not met.
@@ -335,7 +324,7 @@ var describeComponentFrame = function (name, source, ownerName) {
335
324
 
336
325
 
337
326
  // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
338
- var warnAboutDeprecatedLifecycles = false;
327
+ var warnAboutDeprecatedLifecycles = true;
339
328
 
340
329
  // Gather advanced timing metrics for Profiler subtrees.
341
330
 
@@ -352,6 +341,9 @@ var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be f
352
341
  // Only used in www builds.
353
342
 
354
343
 
344
+ // Disable javascript: URL strings in href for XSS protection.
345
+ var disableJavaScriptURLs = false;
346
+
355
347
  // React Fire: prevent the value and checked attributes from syncing
356
348
  // with their related DOM properties
357
349
 
@@ -359,13 +351,56 @@ var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be f
359
351
  // These APIs will no longer be "unstable" in the upcoming 16.7 release,
360
352
  // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
361
353
 
354
+
355
+
356
+
357
+ // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
358
+ // This is a flag so we can fix warnings in RN core before turning it on
359
+
360
+
361
+ // Experimental React Flare event system and event components support.
362
+ var enableFlareAPI = false;
363
+
364
+ // Experimental Host Component support.
365
+ var enableFundamentalAPI = false;
366
+
367
+ // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
368
+
369
+
370
+ // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
371
+ // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
372
+
373
+ // Temporary flag to revert the fix in #15650
374
+
375
+
376
+ // For tests, we flush suspense fallbacks in an act scope;
377
+ // *except* in some of our own tests, where we test incremental loading states.
378
+
379
+
380
+ // Changes priority of some events like mousemove to user-blocking priority,
381
+ // but without making them discrete. The flag exists in case it causes
382
+ // starvation problems.
383
+
384
+
385
+ // Add a callback property to suspense to notify which promises are currently
386
+ // in the update queue. This allows reporting and tracing of what is causing
387
+ // the user to see a loading state.
388
+
389
+
390
+ // Part of the simplification of React.createElement so we can eventually move
391
+ // from React.createElement to React.jsx
392
+ // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
393
+
394
+
395
+ var disableLegacyContext = false;
396
+
362
397
  var ReactDebugCurrentFrame$1 = void 0;
398
+ var didWarnAboutInvalidateContextType = void 0;
363
399
  {
364
400
  ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
401
+ didWarnAboutInvalidateContextType = new Set();
365
402
  }
366
403
 
367
- var didWarnAboutInvalidateContextType = {};
368
-
369
404
  var emptyObject = {};
370
405
  {
371
406
  Object.freeze(emptyObject);
@@ -403,28 +438,72 @@ function validateContextBounds(context, threadID) {
403
438
  }
404
439
  }
405
440
 
406
- function processContext(type, context, threadID) {
407
- var contextType = type.contextType;
408
- if (typeof contextType === 'object' && contextType !== null) {
441
+ function processContext(type, context, threadID, isClass) {
442
+ if (isClass) {
443
+ var contextType = type.contextType;
409
444
  {
410
- if (contextType.$$typeof !== REACT_CONTEXT_TYPE) {
411
- var name = getComponentName(type) || 'Component';
412
- if (!didWarnAboutInvalidateContextType[name]) {
413
- didWarnAboutInvalidateContextType[name] = true;
414
- warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', name);
445
+ if ('contextType' in type) {
446
+ var isValid =
447
+ // Allow null for conditional declaration
448
+ contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
449
+
450
+ if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {
451
+ didWarnAboutInvalidateContextType.add(type);
452
+
453
+ var addendum = '';
454
+ if (contextType === undefined) {
455
+ addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
456
+ } else if (typeof contextType !== 'object') {
457
+ addendum = ' However, it is set to a ' + typeof contextType + '.';
458
+ } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
459
+ addendum = ' Did you accidentally pass the Context.Provider instead?';
460
+ } else if (contextType._context !== undefined) {
461
+ // <Context.Consumer>
462
+ addendum = ' Did you accidentally pass the Context.Consumer instead?';
463
+ } else {
464
+ addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
465
+ }
466
+ warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
467
+ }
468
+ }
469
+ }
470
+ if (typeof contextType === 'object' && contextType !== null) {
471
+ validateContextBounds(contextType, threadID);
472
+ return contextType[threadID];
473
+ }
474
+ if (disableLegacyContext) {
475
+ {
476
+ if (type.contextTypes) {
477
+ warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
415
478
  }
416
479
  }
480
+ return emptyObject;
481
+ } else {
482
+ var maskedContext = maskContext(type, context);
483
+ {
484
+ if (type.contextTypes) {
485
+ checkContextTypes(type.contextTypes, maskedContext, 'context');
486
+ }
487
+ }
488
+ return maskedContext;
417
489
  }
418
- validateContextBounds(contextType, threadID);
419
- return contextType[threadID];
420
490
  } else {
421
- var maskedContext = maskContext(type, context);
422
- {
423
- if (type.contextTypes) {
424
- checkContextTypes(type.contextTypes, maskedContext, 'context');
491
+ if (disableLegacyContext) {
492
+ {
493
+ if (type.contextTypes) {
494
+ warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
495
+ }
425
496
  }
497
+ return undefined;
498
+ } else {
499
+ var _maskedContext = maskContext(type, context);
500
+ {
501
+ if (type.contextTypes) {
502
+ checkContextTypes(type.contextTypes, _maskedContext, 'context');
503
+ }
504
+ }
505
+ return _maskedContext;
426
506
  }
427
- return maskedContext;
428
507
  }
429
508
  }
430
509
 
@@ -442,7 +521,13 @@ function growThreadCountAndReturnNextAvailable() {
442
521
  var oldArray = nextAvailableThreadIDs;
443
522
  var oldSize = oldArray.length;
444
523
  var newSize = oldSize * 2;
445
- !(newSize <= 0x10000) ? invariant(false, 'Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.') : void 0;
524
+ (function () {
525
+ if (!(newSize <= 0x10000)) {
526
+ {
527
+ throw ReactError(Error('Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.'));
528
+ }
529
+ }
530
+ })();
446
531
  var newArray = new Uint16Array(newSize);
447
532
  newArray.set(oldArray);
448
533
  nextAvailableThreadIDs = newArray;
@@ -601,13 +686,14 @@ function getPropertyInfo(name) {
601
686
  return properties.hasOwnProperty(name) ? properties[name] : null;
602
687
  }
603
688
 
604
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
689
+ function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
605
690
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
606
691
  this.attributeName = attributeName;
607
692
  this.attributeNamespace = attributeNamespace;
608
693
  this.mustUseProperty = mustUseProperty;
609
694
  this.propertyName = name;
610
695
  this.type = type;
696
+ this.sanitizeURL = sanitizeURL;
611
697
  }
612
698
 
613
699
  // When adding attributes to this list, be sure to also add them to
@@ -623,8 +709,9 @@ var properties = {};
623
709
  'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
624
710
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
625
711
  name, // attributeName
626
- null);
627
- } // attributeNamespace
712
+ null, // attributeNamespace
713
+ false);
714
+ } // sanitizeURL
628
715
  );
629
716
 
630
717
  // A few React string attributes have a different name.
@@ -635,8 +722,9 @@ var properties = {};
635
722
 
636
723
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
637
724
  attributeName, // attributeName
638
- null);
639
- } // attributeNamespace
725
+ null, // attributeNamespace
726
+ false);
727
+ } // sanitizeURL
640
728
  );
641
729
 
642
730
  // These are "enumerated" HTML attributes that accept "true" and "false".
@@ -645,8 +733,9 @@ var properties = {};
645
733
  ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
646
734
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
647
735
  name.toLowerCase(), // attributeName
648
- null);
649
- } // attributeNamespace
736
+ null, // attributeNamespace
737
+ false);
738
+ } // sanitizeURL
650
739
  );
651
740
 
652
741
  // These are "enumerated" SVG attributes that accept "true" and "false".
@@ -656,21 +745,23 @@ var properties = {};
656
745
  ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
657
746
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
658
747
  name, // attributeName
659
- null);
660
- } // attributeNamespace
748
+ null, // attributeNamespace
749
+ false);
750
+ } // sanitizeURL
661
751
  );
662
752
 
663
753
  // These are HTML boolean attributes.
664
754
  ['allowFullScreen', 'async',
665
755
  // Note: there is a special case that prevents it from being written to the DOM
666
756
  // on the client side because the browsers are inconsistent. Instead we call focus().
667
- 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
757
+ 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
668
758
  // Microdata
669
759
  'itemScope'].forEach(function (name) {
670
760
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
671
761
  name.toLowerCase(), // attributeName
672
- null);
673
- } // attributeNamespace
762
+ null, // attributeNamespace
763
+ false);
764
+ } // sanitizeURL
674
765
  );
675
766
 
676
767
  // These are the few React props that we set as DOM properties
@@ -681,8 +772,9 @@ var properties = {};
681
772
  'multiple', 'muted', 'selected'].forEach(function (name) {
682
773
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
683
774
  name, // attributeName
684
- null);
685
- } // attributeNamespace
775
+ null, // attributeNamespace
776
+ false);
777
+ } // sanitizeURL
686
778
  );
687
779
 
688
780
  // These are HTML attributes that are "overloaded booleans": they behave like
@@ -690,24 +782,27 @@ var properties = {};
690
782
  ['capture', 'download'].forEach(function (name) {
691
783
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
692
784
  name, // attributeName
693
- null);
694
- } // attributeNamespace
785
+ null, // attributeNamespace
786
+ false);
787
+ } // sanitizeURL
695
788
  );
696
789
 
697
790
  // These are HTML attributes that must be positive numbers.
698
791
  ['cols', 'rows', 'size', 'span'].forEach(function (name) {
699
792
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
700
793
  name, // attributeName
701
- null);
702
- } // attributeNamespace
794
+ null, // attributeNamespace
795
+ false);
796
+ } // sanitizeURL
703
797
  );
704
798
 
705
799
  // These are HTML attributes that must be numbers.
706
800
  ['rowSpan', 'start'].forEach(function (name) {
707
801
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
708
802
  name.toLowerCase(), // attributeName
709
- null);
710
- } // attributeNamespace
803
+ null, // attributeNamespace
804
+ false);
805
+ } // sanitizeURL
711
806
  );
712
807
 
713
808
  var CAMELIZE = /[\-\:]([a-z])/g;
@@ -723,23 +818,26 @@ var capitalize = function (token) {
723
818
  ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
724
819
  var name = attributeName.replace(CAMELIZE, capitalize);
725
820
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
726
- attributeName, null);
727
- } // attributeNamespace
821
+ attributeName, null, // attributeNamespace
822
+ false);
823
+ } // sanitizeURL
728
824
  );
729
825
 
730
826
  // String SVG attributes with the xlink namespace.
731
- ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
827
+ ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
732
828
  var name = attributeName.replace(CAMELIZE, capitalize);
733
829
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
734
- attributeName, 'http://www.w3.org/1999/xlink');
735
- });
830
+ attributeName, 'http://www.w3.org/1999/xlink', false);
831
+ } // sanitizeURL
832
+ );
736
833
 
737
834
  // String SVG attributes with the xml namespace.
738
835
  ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
739
836
  var name = attributeName.replace(CAMELIZE, capitalize);
740
837
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
741
- attributeName, 'http://www.w3.org/XML/1998/namespace');
742
- });
838
+ attributeName, 'http://www.w3.org/XML/1998/namespace', false);
839
+ } // sanitizeURL
840
+ );
743
841
 
744
842
  // These attribute exists both in HTML and SVG.
745
843
  // The attribute name is case-sensitive in SVG so we can't just use
@@ -747,10 +845,59 @@ var capitalize = function (token) {
747
845
  ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
748
846
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
749
847
  attributeName.toLowerCase(), // attributeName
750
- null);
751
- } // attributeNamespace
848
+ null, // attributeNamespace
849
+ false);
850
+ } // sanitizeURL
752
851
  );
753
852
 
853
+ // These attributes accept URLs. These must not allow javascript: URLS.
854
+ // These will also need to accept Trusted Types object in the future.
855
+ var xlinkHref = 'xlinkHref';
856
+ properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
857
+ 'xlink:href', 'http://www.w3.org/1999/xlink', true);
858
+
859
+ ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
860
+ properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
861
+ attributeName.toLowerCase(), // attributeName
862
+ null, // attributeNamespace
863
+ true);
864
+ } // sanitizeURL
865
+ );
866
+
867
+ var ReactDebugCurrentFrame$2 = null;
868
+ {
869
+ ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
870
+ }
871
+
872
+ // A javascript: URL can contain leading C0 control or \u0020 SPACE,
873
+ // and any newline or tab are filtered out as if they're not part of the URL.
874
+ // https://url.spec.whatwg.org/#url-parsing
875
+ // Tab or newline are defined as \r\n\t:
876
+ // https://infra.spec.whatwg.org/#ascii-tab-or-newline
877
+ // A C0 control is a code point in the range \u0000 NULL to \u001F
878
+ // INFORMATION SEPARATOR ONE, inclusive:
879
+ // https://infra.spec.whatwg.org/#c0-control-or-space
880
+
881
+ /* eslint-disable max-len */
882
+ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
883
+
884
+ var didWarn = false;
885
+
886
+ function sanitizeURL(url) {
887
+ if (disableJavaScriptURLs) {
888
+ (function () {
889
+ if (!!isJavaScriptProtocol.test(url)) {
890
+ {
891
+ throw ReactError(Error('React has blocked a javascript: URL as a security precaution.' + (ReactDebugCurrentFrame$2.getStackAddendum())));
892
+ }
893
+ }
894
+ })();
895
+ } else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
896
+ didWarn = true;
897
+ warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
898
+ }
899
+ }
900
+
754
901
  // code copied and modified from escape-html
755
902
  /**
756
903
  * Module variables.
@@ -882,6 +1029,10 @@ function createMarkupForProperty(name, value) {
882
1029
  if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
883
1030
  return attributeName + '=""';
884
1031
  } else {
1032
+ if (propertyInfo.sanitizeURL) {
1033
+ value = '' + value;
1034
+ sanitizeURL(value);
1035
+ }
885
1036
  return attributeName + '=' + quoteAttributeValueForBrowser(value);
886
1037
  }
887
1038
  } else if (isAttributeNameSafe(name)) {
@@ -932,7 +1083,13 @@ var isInHookUserCodeInDev = false;
932
1083
  var currentHookNameInDev = void 0;
933
1084
 
934
1085
  function resolveCurrentlyRenderingComponent() {
935
- !(currentlyRenderingComponent !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0;
1086
+ (function () {
1087
+ if (!(currentlyRenderingComponent !== null)) {
1088
+ {
1089
+ throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.'));
1090
+ }
1091
+ }
1092
+ })();
936
1093
  {
937
1094
  !!isInHookUserCodeInDev ? warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks') : void 0;
938
1095
  }
@@ -965,7 +1122,13 @@ function areHookInputsEqual(nextDeps, prevDeps) {
965
1122
 
966
1123
  function createHook() {
967
1124
  if (numberOfReRenders > 0) {
968
- invariant(false, 'Rendered more hooks than during the previous render');
1125
+ (function () {
1126
+ {
1127
+ {
1128
+ throw ReactError(Error('Rendered more hooks than during the previous render'));
1129
+ }
1130
+ }
1131
+ })();
969
1132
  }
970
1133
  return {
971
1134
  memoizedState: null,
@@ -1199,7 +1362,13 @@ function useLayoutEffect(create, inputs) {
1199
1362
  }
1200
1363
 
1201
1364
  function dispatchAction(componentIdentity, queue, action) {
1202
- !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;
1365
+ (function () {
1366
+ if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
1367
+ {
1368
+ throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.'));
1369
+ }
1370
+ }
1371
+ })();
1203
1372
 
1204
1373
  if (componentIdentity === currentlyRenderingComponent) {
1205
1374
  // This is a render phase update. Stash it in a lazily-created map of
@@ -1236,6 +1405,13 @@ function useCallback(callback, deps) {
1236
1405
  return callback;
1237
1406
  }
1238
1407
 
1408
+ function useResponder(responder, props) {
1409
+ return {
1410
+ props: props,
1411
+ responder: responder
1412
+ };
1413
+ }
1414
+
1239
1415
  function noop() {}
1240
1416
 
1241
1417
  var currentThreadID = 0;
@@ -1258,7 +1434,8 @@ var Dispatcher = {
1258
1434
  // Effects are not run in the server environment.
1259
1435
  useEffect: noop,
1260
1436
  // Debugging effect
1261
- useDebugValue: noop
1437
+ useDebugValue: noop,
1438
+ useResponder: useResponder
1262
1439
  };
1263
1440
 
1264
1441
  var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
@@ -1296,14 +1473,14 @@ function getChildNamespace(parentNamespace, type) {
1296
1473
  return parentNamespace;
1297
1474
  }
1298
1475
 
1299
- var ReactDebugCurrentFrame$2 = null;
1476
+ var ReactDebugCurrentFrame$3 = null;
1300
1477
 
1301
1478
  var ReactControlledValuePropTypes = {
1302
1479
  checkPropTypes: null
1303
1480
  };
1304
1481
 
1305
1482
  {
1306
- ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
1483
+ ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
1307
1484
 
1308
1485
  var hasReadOnlyValue = {
1309
1486
  button: true,
@@ -1317,13 +1494,13 @@ var ReactControlledValuePropTypes = {
1317
1494
 
1318
1495
  var propTypes = {
1319
1496
  value: function (props, propName, componentName) {
1320
- if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
1497
+ if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
1321
1498
  return null;
1322
1499
  }
1323
1500
  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`.');
1324
1501
  },
1325
1502
  checked: function (props, propName, componentName) {
1326
- if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
1503
+ if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
1327
1504
  return null;
1328
1505
  }
1329
1506
  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`.');
@@ -1335,7 +1512,7 @@ var ReactControlledValuePropTypes = {
1335
1512
  * this outside of the ReactDOM controlled form components.
1336
1513
  */
1337
1514
  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
1338
- checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
1515
+ checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$3.getStackAddendum);
1339
1516
  };
1340
1517
  }
1341
1518
 
@@ -1372,9 +1549,9 @@ var voidElementTags = _assign({
1372
1549
  // or add stack by default to invariants where possible.
1373
1550
  var HTML = '__html';
1374
1551
 
1375
- var ReactDebugCurrentFrame$3 = null;
1552
+ var ReactDebugCurrentFrame$4 = null;
1376
1553
  {
1377
- ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
1554
+ ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
1378
1555
  }
1379
1556
 
1380
1557
  function assertValidProps(tag, props) {
@@ -1383,16 +1560,40 @@ function assertValidProps(tag, props) {
1383
1560
  }
1384
1561
  // Note the use of `==` which checks for null or undefined.
1385
1562
  if (voidElementTags[tag]) {
1386
- !(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$3.getStackAddendum()) : void 0;
1563
+ (function () {
1564
+ if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
1565
+ {
1566
+ throw ReactError(Error(tag + ' is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.' + (ReactDebugCurrentFrame$4.getStackAddendum())));
1567
+ }
1568
+ }
1569
+ })();
1387
1570
  }
1388
1571
  if (props.dangerouslySetInnerHTML != null) {
1389
- !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
1390
- !(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;
1572
+ (function () {
1573
+ if (!(props.children == null)) {
1574
+ {
1575
+ throw ReactError(Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.'));
1576
+ }
1577
+ }
1578
+ })();
1579
+ (function () {
1580
+ if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
1581
+ {
1582
+ throw ReactError(Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.'));
1583
+ }
1584
+ }
1585
+ })();
1391
1586
  }
1392
1587
  {
1393
1588
  !(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;
1394
1589
  }
1395
- !(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$3.getStackAddendum()) : void 0;
1590
+ (function () {
1591
+ if (!(props.style == null || typeof props.style === 'object')) {
1592
+ {
1593
+ throw ReactError(Error('The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.' + (ReactDebugCurrentFrame$4.getStackAddendum())));
1594
+ }
1595
+ }
1596
+ })();
1396
1597
  }
1397
1598
 
1398
1599
  /**
@@ -1893,6 +2094,7 @@ var possibleStandardNames = {
1893
2094
  defer: 'defer',
1894
2095
  dir: 'dir',
1895
2096
  disabled: 'disabled',
2097
+ disablepictureinpicture: 'disablePictureInPicture',
1896
2098
  download: 'download',
1897
2099
  draggable: 'draggable',
1898
2100
  enctype: 'encType',
@@ -2599,6 +2801,7 @@ var didWarnDefaultTextareaValue = false;
2599
2801
  var didWarnInvalidOptionChildren = false;
2600
2802
  var didWarnAboutNoopUpdateForComponent = {};
2601
2803
  var didWarnAboutBadClass = {};
2804
+ var didWarnAboutModulePatternComponent = {};
2602
2805
  var didWarnAboutDeprecatedWillMount = {};
2603
2806
  var didWarnAboutUndefinedDerivedState = {};
2604
2807
  var didWarnAboutUninitializedState = {};
@@ -2616,7 +2819,13 @@ var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
2616
2819
  var validatedTagCache = {};
2617
2820
  function validateDangerousTag(tag) {
2618
2821
  if (!validatedTagCache.hasOwnProperty(tag)) {
2619
- !VALID_TAG_REGEX.test(tag) ? invariant(false, 'Invalid tag: %s', tag) : void 0;
2822
+ (function () {
2823
+ if (!VALID_TAG_REGEX.test(tag)) {
2824
+ {
2825
+ throw ReactError(Error('Invalid tag: ' + tag));
2826
+ }
2827
+ }
2828
+ })();
2620
2829
  validatedTagCache[tag] = true;
2621
2830
  }
2622
2831
  }
@@ -2646,7 +2855,7 @@ function createMarkupForStyles(styles) {
2646
2855
  }
2647
2856
  }
2648
2857
  if (styleValue != null) {
2649
- serialized += delimiter + processStyleName(styleName) + ':';
2858
+ serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';
2650
2859
  serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
2651
2860
 
2652
2861
  delimiter = ';';
@@ -2742,6 +2951,9 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
2742
2951
  if (!hasOwnProperty.call(props, propKey)) {
2743
2952
  continue;
2744
2953
  }
2954
+ if (enableFlareAPI && propKey === 'listeners') {
2955
+ continue;
2956
+ }
2745
2957
  var propValue = props[propKey];
2746
2958
  if (propValue == null) {
2747
2959
  continue;
@@ -2776,7 +2988,13 @@ function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeSt
2776
2988
 
2777
2989
  function validateRenderResult(child, type) {
2778
2990
  if (child === undefined) {
2779
- invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', getComponentName(type) || 'Component');
2991
+ (function () {
2992
+ {
2993
+ {
2994
+ throw ReactError(Error((getComponentName(type) || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));
2995
+ }
2996
+ }
2997
+ })();
2780
2998
  }
2781
2999
  }
2782
3000
 
@@ -2796,7 +3014,8 @@ function resolve(child, context, threadID) {
2796
3014
 
2797
3015
  // Extra closure so queue and replace can be captured properly
2798
3016
  function processChild(element, Component) {
2799
- var publicContext = processContext(Component, context, threadID);
3017
+ var isClass = shouldConstruct(Component);
3018
+ var publicContext = processContext(Component, context, threadID, isClass);
2800
3019
 
2801
3020
  var queue = [];
2802
3021
  var replace = false;
@@ -2824,7 +3043,7 @@ function resolve(child, context, threadID) {
2824
3043
  };
2825
3044
 
2826
3045
  var inst = void 0;
2827
- if (shouldConstruct(Component)) {
3046
+ if (isClass) {
2828
3047
  inst = new Component(element.props, publicContext, updater);
2829
3048
 
2830
3049
  if (typeof Component.getDerivedStateFromProps === 'function') {
@@ -2875,6 +3094,14 @@ function resolve(child, context, threadID) {
2875
3094
  validateRenderResult(child, Component);
2876
3095
  return;
2877
3096
  }
3097
+
3098
+ {
3099
+ var _componentName3 = getComponentName(Component) || 'Unknown';
3100
+ if (!didWarnAboutModulePatternComponent[_componentName3]) {
3101
+ warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName3, _componentName3, _componentName3);
3102
+ didWarnAboutModulePatternComponent[_componentName3] = true;
3103
+ }
3104
+ }
2878
3105
  }
2879
3106
 
2880
3107
  inst.props = element.props;
@@ -2889,11 +3116,13 @@ function resolve(child, context, threadID) {
2889
3116
  if (typeof inst.componentWillMount === 'function') {
2890
3117
  {
2891
3118
  if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
2892
- var _componentName3 = getComponentName(Component) || 'Unknown';
3119
+ var _componentName4 = getComponentName(Component) || 'Unknown';
2893
3120
 
2894
- if (!didWarnAboutDeprecatedWillMount[_componentName3]) {
2895
- lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);
2896
- didWarnAboutDeprecatedWillMount[_componentName3] = true;
3121
+ if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
3122
+ lowPriorityWarning$1(false,
3123
+ // keep this warning in sync with ReactStrictModeWarning.js
3124
+ 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-async-component-lifecycle-hooks for details.\n\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\n' + '\nPlease update the following components: %s', _componentName4);
3125
+ didWarnAboutDeprecatedWillMount[_componentName4] = true;
2897
3126
  }
2898
3127
  }
2899
3128
  }
@@ -2950,19 +3179,34 @@ function resolve(child, context, threadID) {
2950
3179
  validateRenderResult(child, Component);
2951
3180
 
2952
3181
  var childContext = void 0;
2953
- if (typeof inst.getChildContext === 'function') {
2954
- var childContextTypes = Component.childContextTypes;
2955
- if (typeof childContextTypes === 'object') {
2956
- childContext = inst.getChildContext();
2957
- for (var contextKey in childContext) {
2958
- !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
3182
+ if (disableLegacyContext) {
3183
+ {
3184
+ var childContextTypes = Component.childContextTypes;
3185
+ if (childContextTypes !== undefined) {
3186
+ warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
2959
3187
  }
2960
- } else {
2961
- warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
2962
3188
  }
2963
- }
2964
- if (childContext) {
2965
- context = _assign({}, context, childContext);
3189
+ } else {
3190
+ if (typeof inst.getChildContext === 'function') {
3191
+ var _childContextTypes = Component.childContextTypes;
3192
+ if (typeof _childContextTypes === 'object') {
3193
+ childContext = inst.getChildContext();
3194
+ for (var contextKey in childContext) {
3195
+ (function () {
3196
+ if (!(contextKey in _childContextTypes)) {
3197
+ {
3198
+ throw ReactError(Error((getComponentName(Component) || 'Unknown') + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'));
3199
+ }
3200
+ }
3201
+ })();
3202
+ }
3203
+ } else {
3204
+ warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
3205
+ }
3206
+ }
3207
+ if (childContext) {
3208
+ context = _assign({}, context, childContext);
3209
+ }
2966
3210
  }
2967
3211
  }
2968
3212
  return { child: child, context: context };
@@ -3118,8 +3362,15 @@ var ReactDOMServerRenderer = function () {
3118
3362
  suspended = false;
3119
3363
  // If rendering was suspended at this boundary, render the fallbackFrame
3120
3364
  var _fallbackFrame = frame.fallbackFrame;
3121
- !_fallbackFrame ? invariant(false, 'suspense fallback not found, something is broken') : void 0;
3365
+ (function () {
3366
+ if (!_fallbackFrame) {
3367
+ {
3368
+ throw ReactError(Error('suspense fallback not found, something is broken'));
3369
+ }
3370
+ }
3371
+ })();
3122
3372
  this.stack.push(_fallbackFrame);
3373
+ out[this.suspenseDepth] += '<!--$!-->';
3123
3374
  // Skip flushing output since we're switching to the fallback
3124
3375
  continue;
3125
3376
  } else {
@@ -3192,9 +3443,21 @@ var ReactDOMServerRenderer = function () {
3192
3443
  if (nextChild != null && nextChild.$$typeof != null) {
3193
3444
  // Catch unexpected special types early.
3194
3445
  var $$typeof = nextChild.$$typeof;
3195
- !($$typeof !== REACT_PORTAL_TYPE) ? invariant(false, 'Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.') : void 0;
3446
+ (function () {
3447
+ if (!($$typeof !== REACT_PORTAL_TYPE)) {
3448
+ {
3449
+ throw ReactError(Error('Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.'));
3450
+ }
3451
+ }
3452
+ })();
3196
3453
  // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
3197
- invariant(false, 'Unknown element-like object type: %s. This is likely a bug in React. Please file an issue.', $$typeof.toString());
3454
+ (function () {
3455
+ {
3456
+ {
3457
+ throw ReactError(Error('Unknown element-like object type: ' + $$typeof.toString() + '. This is likely a bug in React. Please file an issue.'));
3458
+ }
3459
+ }
3460
+ })();
3198
3461
  }
3199
3462
  var nextChildren = toArray(nextChild);
3200
3463
  var frame = {
@@ -3223,6 +3486,7 @@ var ReactDOMServerRenderer = function () {
3223
3486
  case REACT_STRICT_MODE_TYPE:
3224
3487
  case REACT_CONCURRENT_MODE_TYPE:
3225
3488
  case REACT_PROFILER_TYPE:
3489
+ case REACT_SUSPENSE_LIST_TYPE:
3226
3490
  case REACT_FRAGMENT_TYPE:
3227
3491
  {
3228
3492
  var _nextChildren = toArray(nextChild.props.children);
@@ -3269,8 +3533,7 @@ var ReactDOMServerRenderer = function () {
3269
3533
  children: fallbackChildren,
3270
3534
  childIndex: 0,
3271
3535
  context: context,
3272
- footer: '',
3273
- out: ''
3536
+ footer: '<!--/$-->'
3274
3537
  };
3275
3538
  var _frame2 = {
3276
3539
  fallbackFrame: _fallbackFrame2,
@@ -3289,7 +3552,13 @@ var ReactDOMServerRenderer = function () {
3289
3552
  this.suspenseDepth++;
3290
3553
  return '<!--$-->';
3291
3554
  } else {
3292
- invariant(false, 'ReactDOMServer does not yet support Suspense.');
3555
+ (function () {
3556
+ {
3557
+ {
3558
+ throw ReactError(Error('ReactDOMServer does not yet support Suspense.'));
3559
+ }
3560
+ }
3561
+ })();
3293
3562
  }
3294
3563
  }
3295
3564
  // eslint-disable-next-line-no-fallthrough
@@ -3406,8 +3675,46 @@ var ReactDOMServerRenderer = function () {
3406
3675
  this.stack.push(_frame7);
3407
3676
  return '';
3408
3677
  }
3678
+ // eslint-disable-next-line-no-fallthrough
3679
+ case REACT_FUNDAMENTAL_TYPE:
3680
+ {
3681
+ if (enableFundamentalAPI) {
3682
+ var fundamentalImpl = elementType.impl;
3683
+ var open = fundamentalImpl.getServerSideString(null, nextElement.props);
3684
+ var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
3685
+ var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
3686
+ var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
3687
+ var _frame8 = {
3688
+ type: null,
3689
+ domNamespace: parentNamespace,
3690
+ children: _nextChildren8,
3691
+ childIndex: 0,
3692
+ context: context,
3693
+ footer: close
3694
+ };
3695
+ {
3696
+ _frame8.debugElementStack = [];
3697
+ }
3698
+ this.stack.push(_frame8);
3699
+ return open;
3700
+ }
3701
+ (function () {
3702
+ {
3703
+ {
3704
+ throw ReactError(Error('ReactDOMServer does not yet support the fundamental API.'));
3705
+ }
3706
+ }
3707
+ })();
3708
+ }
3709
+ // eslint-disable-next-line-no-fallthrough
3409
3710
  case REACT_LAZY_TYPE:
3410
- invariant(false, 'ReactDOMServer does not yet support lazy-loaded components.');
3711
+ (function () {
3712
+ {
3713
+ {
3714
+ throw ReactError(Error('ReactDOMServer does not yet support lazy-loaded components.'));
3715
+ }
3716
+ }
3717
+ })();
3411
3718
  }
3412
3719
  }
3413
3720
 
@@ -3422,7 +3729,13 @@ var ReactDOMServerRenderer = function () {
3422
3729
  info += '\n\nCheck the render method of `' + ownerName + '`.';
3423
3730
  }
3424
3731
  }
3425
- invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', elementType == null ? elementType : typeof elementType, info);
3732
+ (function () {
3733
+ {
3734
+ {
3735
+ throw ReactError(Error('Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ' + (elementType == null ? elementType : typeof elementType) + '.' + info));
3736
+ }
3737
+ }
3738
+ })();
3426
3739
  }
3427
3740
  };
3428
3741
 
@@ -3485,9 +3798,21 @@ var ReactDOMServerRenderer = function () {
3485
3798
  {
3486
3799
  warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
3487
3800
  }
3488
- !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
3801
+ (function () {
3802
+ if (!(defaultValue == null)) {
3803
+ {
3804
+ throw ReactError(Error('If you supply `defaultValue` on a <textarea>, do not pass children.'));
3805
+ }
3806
+ }
3807
+ })();
3489
3808
  if (Array.isArray(textareaChildren)) {
3490
- !(textareaChildren.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
3809
+ (function () {
3810
+ if (!(textareaChildren.length <= 1)) {
3811
+ {
3812
+ throw ReactError(Error('<textarea> can only have at most one child.'));
3813
+ }
3814
+ }
3815
+ })();
3491
3816
  textareaChildren = textareaChildren[0];
3492
3817
  }
3493
3818
 
@@ -3648,11 +3973,23 @@ function renderToStaticMarkup(element) {
3648
3973
  }
3649
3974
 
3650
3975
  function renderToNodeStream() {
3651
- invariant(false, 'ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.');
3976
+ (function () {
3977
+ {
3978
+ {
3979
+ throw ReactError(Error('ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.'));
3980
+ }
3981
+ }
3982
+ })();
3652
3983
  }
3653
3984
 
3654
3985
  function renderToStaticNodeStream() {
3655
- invariant(false, 'ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.');
3986
+ (function () {
3987
+ {
3988
+ {
3989
+ throw ReactError(Error('ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.'));
3990
+ }
3991
+ }
3992
+ })();
3656
3993
  }
3657
3994
 
3658
3995
  // Note: when changing this, also consider https://github.com/facebook/react/issues/11526