react-dom 16.4.0-alpha.7926752 → 16.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-dom-server.browser.development.js +127 -106
- package/cjs/react-dom-server.browser.production.min.js +30 -30
- package/cjs/react-dom-server.node.development.js +128 -107
- package/cjs/react-dom-server.node.production.min.js +32 -32
- package/cjs/react-dom-test-utils.development.js +145 -150
- package/cjs/react-dom-test-utils.production.min.js +25 -26
- package/cjs/react-dom-unstable-native-dependencies.development.js +81 -61
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +27 -28
- package/cjs/react-dom.development.js +11357 -11092
- package/cjs/react-dom.production.min.js +227 -245
- package/package.json +2 -2
- package/umd/react-dom-server.browser.development.js +131 -110
- package/umd/react-dom-server.browser.production.min.js +28 -28
- package/umd/react-dom-test-utils.development.js +145 -150
- package/umd/react-dom-test-utils.production.min.js +20 -21
- package/umd/react-dom-unstable-native-dependencies.development.js +82 -62
- package/umd/react-dom-unstable-native-dependencies.production.min.js +23 -23
- package/umd/react-dom.development.js +11468 -11203
- package/umd/react-dom.production.min.js +186 -205
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dom",
|
|
3
|
-
"version": "16.4.0
|
|
3
|
+
"version": "16.4.0",
|
|
4
4
|
"description": "React package for working with the DOM.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "facebook/react",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"prop-types": "^15.6.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"react": "^16.0.0
|
|
22
|
+
"react": "^16.0.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"LICENSE",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.0
|
|
1
|
+
/** @license React v16.4.0
|
|
2
2
|
* react-dom-server.browser.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -15,17 +15,6 @@
|
|
|
15
15
|
(global.ReactDOMServer = factory(global.React));
|
|
16
16
|
}(this, (function (React) { 'use strict';
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* WARNING: DO NOT manually require this module.
|
|
20
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
|
21
|
-
* and will _only_ be required by the corresponding babel pass.
|
|
22
|
-
* It always throws.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
// TODO: this is special because it gets imported during build.
|
|
26
|
-
|
|
27
|
-
var ReactVersion = '16.4.0-alpha.7926752';
|
|
28
|
-
|
|
29
18
|
/**
|
|
30
19
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
31
20
|
*
|
|
@@ -80,6 +69,13 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
|
|
80
69
|
|
|
81
70
|
var invariant_1 = invariant;
|
|
82
71
|
|
|
72
|
+
// Relying on the `invariant()` implementation lets us
|
|
73
|
+
// have preserve the format and params in the www builds.
|
|
74
|
+
|
|
75
|
+
// TODO: this is special because it gets imported during build.
|
|
76
|
+
|
|
77
|
+
var ReactVersion = '16.4.0';
|
|
78
|
+
|
|
83
79
|
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
84
80
|
|
|
85
81
|
var _assign = ReactInternals.assign;
|
|
@@ -432,16 +428,11 @@ var ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;
|
|
|
432
428
|
// Exports ReactDOM.createRoot
|
|
433
429
|
|
|
434
430
|
|
|
435
|
-
|
|
436
|
-
// Mutating mode (React DOM, React ART, React Native):
|
|
437
|
-
|
|
438
|
-
// Experimental noop mode (currently unused):
|
|
439
|
-
|
|
440
|
-
// Experimental persistent mode (Fabric):
|
|
441
|
-
|
|
442
431
|
// Experimental error-boundary API that can recover from errors within a single
|
|
443
432
|
// render phase
|
|
444
433
|
|
|
434
|
+
// Suspense
|
|
435
|
+
|
|
445
436
|
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
446
437
|
|
|
447
438
|
|
|
@@ -458,21 +449,30 @@ var ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;
|
|
|
458
449
|
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
459
450
|
var warnAboutDeprecatedLifecycles = false;
|
|
460
451
|
|
|
452
|
+
// Warn about legacy context API
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
// Fires getDerivedStateFromProps for state *or* props changes
|
|
459
|
+
|
|
460
|
+
|
|
461
461
|
// Only used in www builds.
|
|
462
462
|
|
|
463
463
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
464
464
|
// nor polyfill, then a plain number is used for performance.
|
|
465
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol
|
|
465
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
466
466
|
|
|
467
467
|
|
|
468
|
-
var
|
|
469
|
-
var
|
|
470
|
-
var
|
|
471
|
-
var
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
var
|
|
468
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
469
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
470
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
471
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
472
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
473
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
474
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
475
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
476
476
|
|
|
477
477
|
// A reserved attribute.
|
|
478
478
|
// It is handled by React separately and shouldn't be written to the DOM.
|
|
@@ -584,6 +584,9 @@ function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)
|
|
|
584
584
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
|
585
585
|
return true;
|
|
586
586
|
}
|
|
587
|
+
if (isCustomComponentTag) {
|
|
588
|
+
return false;
|
|
589
|
+
}
|
|
587
590
|
if (propertyInfo !== null) {
|
|
588
591
|
switch (propertyInfo.type) {
|
|
589
592
|
case BOOLEAN:
|
|
@@ -626,15 +629,20 @@ var properties = {};
|
|
|
626
629
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
627
630
|
name, // attributeName
|
|
628
631
|
null);
|
|
629
|
-
}
|
|
632
|
+
} // attributeNamespace
|
|
633
|
+
);
|
|
630
634
|
|
|
631
635
|
// A few React string attributes have a different name.
|
|
632
636
|
// This is a mapping from React prop names to the attribute names.
|
|
633
|
-
|
|
637
|
+
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
|
638
|
+
var name = _ref[0],
|
|
639
|
+
attributeName = _ref[1];
|
|
640
|
+
|
|
634
641
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
635
642
|
attributeName, // attributeName
|
|
636
643
|
null);
|
|
637
|
-
}
|
|
644
|
+
} // attributeNamespace
|
|
645
|
+
);
|
|
638
646
|
|
|
639
647
|
// These are "enumerated" HTML attributes that accept "true" and "false".
|
|
640
648
|
// In React, we let users pass `true` and `false` even though technically
|
|
@@ -643,7 +651,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
643
651
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
644
652
|
name.toLowerCase(), // attributeName
|
|
645
653
|
null);
|
|
646
|
-
}
|
|
654
|
+
} // attributeNamespace
|
|
655
|
+
);
|
|
647
656
|
|
|
648
657
|
// These are "enumerated" SVG attributes that accept "true" and "false".
|
|
649
658
|
// In React, we let users pass `true` and `false` even though technically
|
|
@@ -653,7 +662,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
653
662
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
654
663
|
name, // attributeName
|
|
655
664
|
null);
|
|
656
|
-
}
|
|
665
|
+
} // attributeNamespace
|
|
666
|
+
);
|
|
657
667
|
|
|
658
668
|
// These are HTML boolean attributes.
|
|
659
669
|
['allowFullScreen', 'async',
|
|
@@ -665,7 +675,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
665
675
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
|
|
666
676
|
name.toLowerCase(), // attributeName
|
|
667
677
|
null);
|
|
668
|
-
}
|
|
678
|
+
} // attributeNamespace
|
|
679
|
+
);
|
|
669
680
|
|
|
670
681
|
// These are the few React props that we set as DOM properties
|
|
671
682
|
// rather than attributes. These are all booleans.
|
|
@@ -676,7 +687,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
676
687
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
677
688
|
name.toLowerCase(), // attributeName
|
|
678
689
|
null);
|
|
679
|
-
}
|
|
690
|
+
} // attributeNamespace
|
|
691
|
+
);
|
|
680
692
|
|
|
681
693
|
// These are HTML attributes that are "overloaded booleans": they behave like
|
|
682
694
|
// booleans, but can also accept a string value.
|
|
@@ -684,21 +696,24 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
684
696
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
685
697
|
name.toLowerCase(), // attributeName
|
|
686
698
|
null);
|
|
687
|
-
}
|
|
699
|
+
} // attributeNamespace
|
|
700
|
+
);
|
|
688
701
|
|
|
689
702
|
// These are HTML attributes that must be positive numbers.
|
|
690
703
|
['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
|
691
704
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
692
705
|
name.toLowerCase(), // attributeName
|
|
693
706
|
null);
|
|
694
|
-
}
|
|
707
|
+
} // attributeNamespace
|
|
708
|
+
);
|
|
695
709
|
|
|
696
710
|
// These are HTML attributes that must be numbers.
|
|
697
711
|
['rowSpan', 'start'].forEach(function (name) {
|
|
698
712
|
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
|
|
699
713
|
name.toLowerCase(), // attributeName
|
|
700
714
|
null);
|
|
701
|
-
}
|
|
715
|
+
} // attributeNamespace
|
|
716
|
+
);
|
|
702
717
|
|
|
703
718
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
704
719
|
var capitalize = function (token) {
|
|
@@ -714,7 +729,8 @@ var capitalize = function (token) {
|
|
|
714
729
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
715
730
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
716
731
|
attributeName, null);
|
|
717
|
-
}
|
|
732
|
+
} // attributeNamespace
|
|
733
|
+
);
|
|
718
734
|
|
|
719
735
|
// String SVG attributes with the xlink namespace.
|
|
720
736
|
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
|
@@ -982,6 +998,7 @@ var omittedCloseTags = {
|
|
|
982
998
|
source: true,
|
|
983
999
|
track: true,
|
|
984
1000
|
wbr: true
|
|
1001
|
+
// NOTE: menuitem's close tag should be omitted, but that causes problems.
|
|
985
1002
|
};
|
|
986
1003
|
|
|
987
1004
|
// For HTML, certain tags cannot have children. This has the same purpose as
|
|
@@ -1006,7 +1023,7 @@ function assertValidProps(tag, props, getStack) {
|
|
|
1006
1023
|
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant_1(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
|
|
1007
1024
|
}
|
|
1008
1025
|
{
|
|
1009
|
-
|
|
1026
|
+
!(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.%s', getStack()) : void 0;
|
|
1010
1027
|
}
|
|
1011
1028
|
!(props.style == null || typeof props.style === 'object') ? invariant_1(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getStack()) : void 0;
|
|
1012
1029
|
}
|
|
@@ -1531,7 +1548,7 @@ var possibleStandardNames = {
|
|
|
1531
1548
|
checked: 'checked',
|
|
1532
1549
|
children: 'children',
|
|
1533
1550
|
cite: 'cite',
|
|
1534
|
-
|
|
1551
|
+
class: 'className',
|
|
1535
1552
|
classid: 'classID',
|
|
1536
1553
|
classname: 'className',
|
|
1537
1554
|
cols: 'cols',
|
|
@@ -1546,7 +1563,7 @@ var possibleStandardNames = {
|
|
|
1546
1563
|
dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
|
1547
1564
|
data: 'data',
|
|
1548
1565
|
datetime: 'dateTime',
|
|
1549
|
-
|
|
1566
|
+
default: 'default',
|
|
1550
1567
|
defaultchecked: 'defaultChecked',
|
|
1551
1568
|
defaultvalue: 'defaultValue',
|
|
1552
1569
|
defer: 'defer',
|
|
@@ -1555,7 +1572,7 @@ var possibleStandardNames = {
|
|
|
1555
1572
|
download: 'download',
|
|
1556
1573
|
draggable: 'draggable',
|
|
1557
1574
|
enctype: 'encType',
|
|
1558
|
-
|
|
1575
|
+
for: 'htmlFor',
|
|
1559
1576
|
form: 'form',
|
|
1560
1577
|
formmethod: 'formMethod',
|
|
1561
1578
|
formaction: 'formAction',
|
|
@@ -1773,7 +1790,7 @@ var possibleStandardNames = {
|
|
|
1773
1790
|
imagerendering: 'imageRendering',
|
|
1774
1791
|
'image-rendering': 'imageRendering',
|
|
1775
1792
|
in2: 'in2',
|
|
1776
|
-
|
|
1793
|
+
in: 'in',
|
|
1777
1794
|
inlist: 'inlist',
|
|
1778
1795
|
intercept: 'intercept',
|
|
1779
1796
|
k1: 'k1',
|
|
@@ -1913,7 +1930,7 @@ var possibleStandardNames = {
|
|
|
1913
1930
|
'text-rendering': 'textRendering',
|
|
1914
1931
|
to: 'to',
|
|
1915
1932
|
transform: 'transform',
|
|
1916
|
-
|
|
1933
|
+
typeof: 'typeof',
|
|
1917
1934
|
u1: 'u1',
|
|
1918
1935
|
u2: 'u2',
|
|
1919
1936
|
underlineposition: 'underlinePosition',
|
|
@@ -2429,42 +2446,26 @@ function validateRenderResult(child, type) {
|
|
|
2429
2446
|
}
|
|
2430
2447
|
|
|
2431
2448
|
function resolve(child, context) {
|
|
2432
|
-
var element = void 0;
|
|
2433
|
-
|
|
2434
|
-
var Component = void 0;
|
|
2435
|
-
var publicContext = void 0;
|
|
2436
|
-
var inst = void 0,
|
|
2437
|
-
queue = void 0,
|
|
2438
|
-
replace = void 0;
|
|
2439
|
-
var updater = void 0;
|
|
2440
|
-
|
|
2441
|
-
var initialState = void 0;
|
|
2442
|
-
var oldQueue = void 0,
|
|
2443
|
-
oldReplace = void 0;
|
|
2444
|
-
var nextState = void 0,
|
|
2445
|
-
dontMutate = void 0;
|
|
2446
|
-
var partial = void 0,
|
|
2447
|
-
partialState = void 0;
|
|
2448
|
-
|
|
2449
|
-
var childContext = void 0;
|
|
2450
|
-
var childContextTypes = void 0,
|
|
2451
|
-
contextKey = void 0;
|
|
2452
|
-
|
|
2453
2449
|
while (React.isValidElement(child)) {
|
|
2454
2450
|
// Safe because we just checked it's an element.
|
|
2455
|
-
element = child;
|
|
2451
|
+
var element = child;
|
|
2452
|
+
var Component = element.type;
|
|
2456
2453
|
{
|
|
2457
2454
|
pushElementToDebugStack(element);
|
|
2458
2455
|
}
|
|
2459
|
-
Component = element.type;
|
|
2460
2456
|
if (typeof Component !== 'function') {
|
|
2461
2457
|
break;
|
|
2462
2458
|
}
|
|
2463
|
-
|
|
2459
|
+
processChild(element, Component);
|
|
2460
|
+
}
|
|
2464
2461
|
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2462
|
+
// Extra closure so queue and replace can be captured properly
|
|
2463
|
+
function processChild(element, Component) {
|
|
2464
|
+
var publicContext = processContext(Component, context);
|
|
2465
|
+
|
|
2466
|
+
var queue = [];
|
|
2467
|
+
var replace = false;
|
|
2468
|
+
var updater = {
|
|
2468
2469
|
isMounted: function (publicInstance) {
|
|
2469
2470
|
return false;
|
|
2470
2471
|
},
|
|
@@ -2487,6 +2488,7 @@ function resolve(child, context) {
|
|
|
2487
2488
|
}
|
|
2488
2489
|
};
|
|
2489
2490
|
|
|
2491
|
+
var inst = void 0;
|
|
2490
2492
|
if (shouldConstruct(Component)) {
|
|
2491
2493
|
inst = new Component(element.props, publicContext, updater);
|
|
2492
2494
|
|
|
@@ -2501,7 +2503,7 @@ function resolve(child, context) {
|
|
|
2501
2503
|
}
|
|
2502
2504
|
}
|
|
2503
2505
|
|
|
2504
|
-
partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2506
|
+
var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2505
2507
|
|
|
2506
2508
|
{
|
|
2507
2509
|
if (partialState === undefined) {
|
|
@@ -2532,7 +2534,7 @@ function resolve(child, context) {
|
|
|
2532
2534
|
if (inst == null || inst.render == null) {
|
|
2533
2535
|
child = inst;
|
|
2534
2536
|
validateRenderResult(child, Component);
|
|
2535
|
-
|
|
2537
|
+
return;
|
|
2536
2538
|
}
|
|
2537
2539
|
}
|
|
2538
2540
|
|
|
@@ -2540,7 +2542,7 @@ function resolve(child, context) {
|
|
|
2540
2542
|
inst.context = publicContext;
|
|
2541
2543
|
inst.updater = updater;
|
|
2542
2544
|
|
|
2543
|
-
initialState = inst.state;
|
|
2545
|
+
var initialState = inst.state;
|
|
2544
2546
|
if (initialState === undefined) {
|
|
2545
2547
|
inst.state = initialState = null;
|
|
2546
2548
|
}
|
|
@@ -2569,25 +2571,25 @@ function resolve(child, context) {
|
|
|
2569
2571
|
inst.UNSAFE_componentWillMount();
|
|
2570
2572
|
}
|
|
2571
2573
|
if (queue.length) {
|
|
2572
|
-
oldQueue = queue;
|
|
2573
|
-
oldReplace = replace;
|
|
2574
|
+
var oldQueue = queue;
|
|
2575
|
+
var oldReplace = replace;
|
|
2574
2576
|
queue = null;
|
|
2575
2577
|
replace = false;
|
|
2576
2578
|
|
|
2577
2579
|
if (oldReplace && oldQueue.length === 1) {
|
|
2578
2580
|
inst.state = oldQueue[0];
|
|
2579
2581
|
} else {
|
|
2580
|
-
nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2581
|
-
dontMutate = true;
|
|
2582
|
+
var nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2583
|
+
var dontMutate = true;
|
|
2582
2584
|
for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
|
2583
|
-
partial = oldQueue[i];
|
|
2584
|
-
|
|
2585
|
-
if (
|
|
2585
|
+
var partial = oldQueue[i];
|
|
2586
|
+
var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
|
2587
|
+
if (_partialState != null) {
|
|
2586
2588
|
if (dontMutate) {
|
|
2587
2589
|
dontMutate = false;
|
|
2588
|
-
nextState = _assign({}, nextState,
|
|
2590
|
+
nextState = _assign({}, nextState, _partialState);
|
|
2589
2591
|
} else {
|
|
2590
|
-
_assign(nextState,
|
|
2592
|
+
_assign(nextState, _partialState);
|
|
2591
2593
|
}
|
|
2592
2594
|
}
|
|
2593
2595
|
}
|
|
@@ -2608,11 +2610,12 @@ function resolve(child, context) {
|
|
|
2608
2610
|
}
|
|
2609
2611
|
validateRenderResult(child, Component);
|
|
2610
2612
|
|
|
2613
|
+
var childContext = void 0;
|
|
2611
2614
|
if (typeof inst.getChildContext === 'function') {
|
|
2612
|
-
childContextTypes = Component.childContextTypes;
|
|
2615
|
+
var childContextTypes = Component.childContextTypes;
|
|
2613
2616
|
if (typeof childContextTypes === 'object') {
|
|
2614
2617
|
childContext = inst.getChildContext();
|
|
2615
|
-
for (contextKey in childContext) {
|
|
2618
|
+
for (var contextKey in childContext) {
|
|
2616
2619
|
!(contextKey in childContextTypes) ? invariant_1(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
|
|
2617
2620
|
}
|
|
2618
2621
|
} else {
|
|
@@ -2661,23 +2664,23 @@ var ReactDOMServerRenderer = function () {
|
|
|
2661
2664
|
ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
|
2662
2665
|
this.providerIndex += 1;
|
|
2663
2666
|
this.providerStack[this.providerIndex] = provider;
|
|
2664
|
-
var context = provider.type.
|
|
2665
|
-
context.
|
|
2667
|
+
var context = provider.type._context;
|
|
2668
|
+
context._currentValue = provider.props.value;
|
|
2666
2669
|
};
|
|
2667
2670
|
|
|
2668
2671
|
ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
|
2669
2672
|
{
|
|
2670
|
-
|
|
2673
|
+
!(this.providerIndex > -1 && provider === this.providerStack[this.providerIndex]) ? warning_1(false, 'Unexpected pop.') : void 0;
|
|
2671
2674
|
}
|
|
2672
2675
|
this.providerStack[this.providerIndex] = null;
|
|
2673
2676
|
this.providerIndex -= 1;
|
|
2674
|
-
var context = provider.type.
|
|
2677
|
+
var context = provider.type._context;
|
|
2675
2678
|
if (this.providerIndex < 0) {
|
|
2676
|
-
context.
|
|
2679
|
+
context._currentValue = context._defaultValue;
|
|
2677
2680
|
} else {
|
|
2678
2681
|
// We assume this type is correct because of the index check above.
|
|
2679
2682
|
var previousProvider = this.providerStack[this.providerIndex];
|
|
2680
|
-
context.
|
|
2683
|
+
context._currentValue = previousProvider.props.value;
|
|
2681
2684
|
}
|
|
2682
2685
|
};
|
|
2683
2686
|
|
|
@@ -2779,6 +2782,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2779
2782
|
switch (elementType) {
|
|
2780
2783
|
case REACT_STRICT_MODE_TYPE:
|
|
2781
2784
|
case REACT_ASYNC_MODE_TYPE:
|
|
2785
|
+
case REACT_PROFILER_TYPE:
|
|
2782
2786
|
case REACT_FRAGMENT_TYPE:
|
|
2783
2787
|
{
|
|
2784
2788
|
var _nextChildren = toArray(nextChild.props.children);
|
|
@@ -2796,56 +2800,71 @@ var ReactDOMServerRenderer = function () {
|
|
|
2796
2800
|
this.stack.push(_frame);
|
|
2797
2801
|
return '';
|
|
2798
2802
|
}
|
|
2799
|
-
case REACT_CALL_TYPE:
|
|
2800
|
-
case REACT_RETURN_TYPE:
|
|
2801
|
-
invariant_1(false, 'The experimental Call and Return types are not currently supported by the server renderer.');
|
|
2802
2803
|
// eslint-disable-next-line-no-fallthrough
|
|
2803
2804
|
default:
|
|
2804
2805
|
break;
|
|
2805
2806
|
}
|
|
2806
2807
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
2807
2808
|
switch (elementType.$$typeof) {
|
|
2809
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2810
|
+
{
|
|
2811
|
+
var element = nextChild;
|
|
2812
|
+
var _nextChildren2 = toArray(elementType.render(element.props, element.ref));
|
|
2813
|
+
var _frame2 = {
|
|
2814
|
+
type: null,
|
|
2815
|
+
domNamespace: parentNamespace,
|
|
2816
|
+
children: _nextChildren2,
|
|
2817
|
+
childIndex: 0,
|
|
2818
|
+
context: context,
|
|
2819
|
+
footer: ''
|
|
2820
|
+
};
|
|
2821
|
+
{
|
|
2822
|
+
_frame2.debugElementStack = [];
|
|
2823
|
+
}
|
|
2824
|
+
this.stack.push(_frame2);
|
|
2825
|
+
return '';
|
|
2826
|
+
}
|
|
2808
2827
|
case REACT_PROVIDER_TYPE:
|
|
2809
2828
|
{
|
|
2810
2829
|
var provider = nextChild;
|
|
2811
2830
|
var nextProps = provider.props;
|
|
2812
|
-
var
|
|
2813
|
-
var
|
|
2831
|
+
var _nextChildren3 = toArray(nextProps.children);
|
|
2832
|
+
var _frame3 = {
|
|
2814
2833
|
type: provider,
|
|
2815
2834
|
domNamespace: parentNamespace,
|
|
2816
|
-
children:
|
|
2835
|
+
children: _nextChildren3,
|
|
2817
2836
|
childIndex: 0,
|
|
2818
2837
|
context: context,
|
|
2819
2838
|
footer: ''
|
|
2820
2839
|
};
|
|
2821
2840
|
{
|
|
2822
|
-
|
|
2841
|
+
_frame3.debugElementStack = [];
|
|
2823
2842
|
}
|
|
2824
2843
|
|
|
2825
2844
|
this.pushProvider(provider);
|
|
2826
2845
|
|
|
2827
|
-
this.stack.push(
|
|
2846
|
+
this.stack.push(_frame3);
|
|
2828
2847
|
return '';
|
|
2829
2848
|
}
|
|
2830
2849
|
case REACT_CONTEXT_TYPE:
|
|
2831
2850
|
{
|
|
2832
2851
|
var consumer = nextChild;
|
|
2833
2852
|
var _nextProps = consumer.props;
|
|
2834
|
-
var nextValue = consumer.type.
|
|
2853
|
+
var nextValue = consumer.type._currentValue;
|
|
2835
2854
|
|
|
2836
|
-
var
|
|
2837
|
-
var
|
|
2855
|
+
var _nextChildren4 = toArray(_nextProps.children(nextValue));
|
|
2856
|
+
var _frame4 = {
|
|
2838
2857
|
type: nextChild,
|
|
2839
2858
|
domNamespace: parentNamespace,
|
|
2840
|
-
children:
|
|
2859
|
+
children: _nextChildren4,
|
|
2841
2860
|
childIndex: 0,
|
|
2842
2861
|
context: context,
|
|
2843
2862
|
footer: ''
|
|
2844
2863
|
};
|
|
2845
2864
|
{
|
|
2846
|
-
|
|
2865
|
+
_frame4.debugElementStack = [];
|
|
2847
2866
|
}
|
|
2848
|
-
this.stack.push(
|
|
2867
|
+
this.stack.push(_frame4);
|
|
2849
2868
|
return '';
|
|
2850
2869
|
}
|
|
2851
2870
|
default:
|
|
@@ -2880,7 +2899,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2880
2899
|
if (namespace === Namespaces.html) {
|
|
2881
2900
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
2882
2901
|
// allow <SVG> or <mATH>.
|
|
2883
|
-
|
|
2902
|
+
!(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;
|
|
2884
2903
|
}
|
|
2885
2904
|
}
|
|
2886
2905
|
|
|
@@ -2956,9 +2975,11 @@ var ReactDOMServerRenderer = function () {
|
|
|
2956
2975
|
}
|
|
2957
2976
|
var isArray = Array.isArray(props[propName]);
|
|
2958
2977
|
if (props.multiple && !isArray) {
|
|
2959
|
-
warning_1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '')
|
|
2978
|
+
warning_1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '' // getDeclarationErrorAddendum(),
|
|
2979
|
+
);
|
|
2960
2980
|
} else if (!props.multiple && isArray) {
|
|
2961
|
-
warning_1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '')
|
|
2981
|
+
warning_1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '' // getDeclarationErrorAddendum(),
|
|
2982
|
+
);
|
|
2962
2983
|
}
|
|
2963
2984
|
}
|
|
2964
2985
|
|
|
@@ -3106,7 +3127,7 @@ var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || Rea
|
|
|
3106
3127
|
|
|
3107
3128
|
// TODO: decide on the top-level export form.
|
|
3108
3129
|
// This is hacky but makes it work with both Rollup and Jest
|
|
3109
|
-
var server_browser = ReactDOMServer
|
|
3130
|
+
var server_browser = ReactDOMServer.default ? ReactDOMServer.default : ReactDOMServer;
|
|
3110
3131
|
|
|
3111
3132
|
return server_browser;
|
|
3112
3133
|
|