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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.4.0
|
|
1
|
+
/** @license React v16.4.0
|
|
2
2
|
* react-dom-server.node.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -16,11 +16,11 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
|
+
var invariant = require('fbjs/lib/invariant');
|
|
19
20
|
var React = require('react');
|
|
20
21
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
21
22
|
var emptyObject = require('fbjs/lib/emptyObject');
|
|
22
23
|
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
|
|
23
|
-
var invariant = require('fbjs/lib/invariant');
|
|
24
24
|
var memoizeStringOnly = require('fbjs/lib/memoizeStringOnly');
|
|
25
25
|
var warning = require('fbjs/lib/warning');
|
|
26
26
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
@@ -29,14 +29,10 @@ var stream = require('stream');
|
|
|
29
29
|
|
|
30
30
|
// TODO: this is special because it gets imported during build.
|
|
31
31
|
|
|
32
|
-
var ReactVersion = '16.4.0
|
|
32
|
+
var ReactVersion = '16.4.0';
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
|
37
|
-
* and will _only_ be required by the corresponding babel pass.
|
|
38
|
-
* It always throws.
|
|
39
|
-
*/
|
|
34
|
+
// Relying on the `invariant()` implementation lets us
|
|
35
|
+
// have preserve the format and params in the www builds.
|
|
40
36
|
|
|
41
37
|
/**
|
|
42
38
|
* Forked from fbjs/warning:
|
|
@@ -103,16 +99,11 @@ var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
|
|
103
99
|
// Exports ReactDOM.createRoot
|
|
104
100
|
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
// Mutating mode (React DOM, React ART, React Native):
|
|
108
|
-
|
|
109
|
-
// Experimental noop mode (currently unused):
|
|
110
|
-
|
|
111
|
-
// Experimental persistent mode (Fabric):
|
|
112
|
-
|
|
113
102
|
// Experimental error-boundary API that can recover from errors within a single
|
|
114
103
|
// render phase
|
|
115
104
|
|
|
105
|
+
// Suspense
|
|
106
|
+
|
|
116
107
|
// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
|
|
117
108
|
|
|
118
109
|
|
|
@@ -129,21 +120,30 @@ var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
|
|
129
120
|
// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
|
130
121
|
var warnAboutDeprecatedLifecycles = false;
|
|
131
122
|
|
|
123
|
+
// Warn about legacy context API
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
// Gather advanced timing metrics for Profiler subtrees.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
// Fires getDerivedStateFromProps for state *or* props changes
|
|
130
|
+
|
|
131
|
+
|
|
132
132
|
// Only used in www builds.
|
|
133
133
|
|
|
134
134
|
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
135
135
|
// nor polyfill, then a plain number is used for performance.
|
|
136
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol
|
|
136
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
var
|
|
146
|
-
var
|
|
139
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
140
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
141
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
142
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
143
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
144
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
145
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
146
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
147
147
|
|
|
148
148
|
// A reserved attribute.
|
|
149
149
|
// It is handled by React separately and shouldn't be written to the DOM.
|
|
@@ -255,6 +255,9 @@ function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)
|
|
|
255
255
|
if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
|
256
256
|
return true;
|
|
257
257
|
}
|
|
258
|
+
if (isCustomComponentTag) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
258
261
|
if (propertyInfo !== null) {
|
|
259
262
|
switch (propertyInfo.type) {
|
|
260
263
|
case BOOLEAN:
|
|
@@ -297,15 +300,20 @@ var properties = {};
|
|
|
297
300
|
properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
|
|
298
301
|
name, // attributeName
|
|
299
302
|
null);
|
|
300
|
-
}
|
|
303
|
+
} // attributeNamespace
|
|
304
|
+
);
|
|
301
305
|
|
|
302
306
|
// A few React string attributes have a different name.
|
|
303
307
|
// This is a mapping from React prop names to the attribute names.
|
|
304
|
-
|
|
308
|
+
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
|
309
|
+
var name = _ref[0],
|
|
310
|
+
attributeName = _ref[1];
|
|
311
|
+
|
|
305
312
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
306
313
|
attributeName, // attributeName
|
|
307
314
|
null);
|
|
308
|
-
}
|
|
315
|
+
} // attributeNamespace
|
|
316
|
+
);
|
|
309
317
|
|
|
310
318
|
// These are "enumerated" HTML attributes that accept "true" and "false".
|
|
311
319
|
// In React, we let users pass `true` and `false` even though technically
|
|
@@ -314,7 +322,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
314
322
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
315
323
|
name.toLowerCase(), // attributeName
|
|
316
324
|
null);
|
|
317
|
-
}
|
|
325
|
+
} // attributeNamespace
|
|
326
|
+
);
|
|
318
327
|
|
|
319
328
|
// These are "enumerated" SVG attributes that accept "true" and "false".
|
|
320
329
|
// In React, we let users pass `true` and `false` even though technically
|
|
@@ -324,7 +333,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
324
333
|
properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
|
|
325
334
|
name, // attributeName
|
|
326
335
|
null);
|
|
327
|
-
}
|
|
336
|
+
} // attributeNamespace
|
|
337
|
+
);
|
|
328
338
|
|
|
329
339
|
// These are HTML boolean attributes.
|
|
330
340
|
['allowFullScreen', 'async',
|
|
@@ -336,7 +346,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
336
346
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
|
|
337
347
|
name.toLowerCase(), // attributeName
|
|
338
348
|
null);
|
|
339
|
-
}
|
|
349
|
+
} // attributeNamespace
|
|
350
|
+
);
|
|
340
351
|
|
|
341
352
|
// These are the few React props that we set as DOM properties
|
|
342
353
|
// rather than attributes. These are all booleans.
|
|
@@ -347,7 +358,8 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
347
358
|
properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
|
|
348
359
|
name.toLowerCase(), // attributeName
|
|
349
360
|
null);
|
|
350
|
-
}
|
|
361
|
+
} // attributeNamespace
|
|
362
|
+
);
|
|
351
363
|
|
|
352
364
|
// These are HTML attributes that are "overloaded booleans": they behave like
|
|
353
365
|
// booleans, but can also accept a string value.
|
|
@@ -355,21 +367,24 @@ new Map([['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor'
|
|
|
355
367
|
properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
|
|
356
368
|
name.toLowerCase(), // attributeName
|
|
357
369
|
null);
|
|
358
|
-
}
|
|
370
|
+
} // attributeNamespace
|
|
371
|
+
);
|
|
359
372
|
|
|
360
373
|
// These are HTML attributes that must be positive numbers.
|
|
361
374
|
['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
|
362
375
|
properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
|
|
363
376
|
name.toLowerCase(), // attributeName
|
|
364
377
|
null);
|
|
365
|
-
}
|
|
378
|
+
} // attributeNamespace
|
|
379
|
+
);
|
|
366
380
|
|
|
367
381
|
// These are HTML attributes that must be numbers.
|
|
368
382
|
['rowSpan', 'start'].forEach(function (name) {
|
|
369
383
|
properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
|
|
370
384
|
name.toLowerCase(), // attributeName
|
|
371
385
|
null);
|
|
372
|
-
}
|
|
386
|
+
} // attributeNamespace
|
|
387
|
+
);
|
|
373
388
|
|
|
374
389
|
var CAMELIZE = /[\-\:]([a-z])/g;
|
|
375
390
|
var capitalize = function (token) {
|
|
@@ -385,7 +400,8 @@ var capitalize = function (token) {
|
|
|
385
400
|
var name = attributeName.replace(CAMELIZE, capitalize);
|
|
386
401
|
properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
|
|
387
402
|
attributeName, null);
|
|
388
|
-
}
|
|
403
|
+
} // attributeNamespace
|
|
404
|
+
);
|
|
389
405
|
|
|
390
406
|
// String SVG attributes with the xlink namespace.
|
|
391
407
|
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
|
@@ -653,6 +669,7 @@ var omittedCloseTags = {
|
|
|
653
669
|
source: true,
|
|
654
670
|
track: true,
|
|
655
671
|
wbr: true
|
|
672
|
+
// NOTE: menuitem's close tag should be omitted, but that causes problems.
|
|
656
673
|
};
|
|
657
674
|
|
|
658
675
|
// For HTML, certain tags cannot have children. This has the same purpose as
|
|
@@ -677,7 +694,7 @@ function assertValidProps(tag, props, getStack) {
|
|
|
677
694
|
!(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;
|
|
678
695
|
}
|
|
679
696
|
{
|
|
680
|
-
|
|
697
|
+
!(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;
|
|
681
698
|
}
|
|
682
699
|
!(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;
|
|
683
700
|
}
|
|
@@ -1136,7 +1153,7 @@ var possibleStandardNames = {
|
|
|
1136
1153
|
checked: 'checked',
|
|
1137
1154
|
children: 'children',
|
|
1138
1155
|
cite: 'cite',
|
|
1139
|
-
|
|
1156
|
+
class: 'className',
|
|
1140
1157
|
classid: 'classID',
|
|
1141
1158
|
classname: 'className',
|
|
1142
1159
|
cols: 'cols',
|
|
@@ -1151,7 +1168,7 @@ var possibleStandardNames = {
|
|
|
1151
1168
|
dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
|
1152
1169
|
data: 'data',
|
|
1153
1170
|
datetime: 'dateTime',
|
|
1154
|
-
|
|
1171
|
+
default: 'default',
|
|
1155
1172
|
defaultchecked: 'defaultChecked',
|
|
1156
1173
|
defaultvalue: 'defaultValue',
|
|
1157
1174
|
defer: 'defer',
|
|
@@ -1160,7 +1177,7 @@ var possibleStandardNames = {
|
|
|
1160
1177
|
download: 'download',
|
|
1161
1178
|
draggable: 'draggable',
|
|
1162
1179
|
enctype: 'encType',
|
|
1163
|
-
|
|
1180
|
+
for: 'htmlFor',
|
|
1164
1181
|
form: 'form',
|
|
1165
1182
|
formmethod: 'formMethod',
|
|
1166
1183
|
formaction: 'formAction',
|
|
@@ -1378,7 +1395,7 @@ var possibleStandardNames = {
|
|
|
1378
1395
|
imagerendering: 'imageRendering',
|
|
1379
1396
|
'image-rendering': 'imageRendering',
|
|
1380
1397
|
in2: 'in2',
|
|
1381
|
-
|
|
1398
|
+
in: 'in',
|
|
1382
1399
|
inlist: 'inlist',
|
|
1383
1400
|
intercept: 'intercept',
|
|
1384
1401
|
k1: 'k1',
|
|
@@ -1518,7 +1535,7 @@ var possibleStandardNames = {
|
|
|
1518
1535
|
'text-rendering': 'textRendering',
|
|
1519
1536
|
to: 'to',
|
|
1520
1537
|
transform: 'transform',
|
|
1521
|
-
|
|
1538
|
+
typeof: 'typeof',
|
|
1522
1539
|
u1: 'u1',
|
|
1523
1540
|
u2: 'u2',
|
|
1524
1541
|
underlineposition: 'underlinePosition',
|
|
@@ -2034,42 +2051,26 @@ function validateRenderResult(child, type) {
|
|
|
2034
2051
|
}
|
|
2035
2052
|
|
|
2036
2053
|
function resolve(child, context) {
|
|
2037
|
-
var element = void 0;
|
|
2038
|
-
|
|
2039
|
-
var Component = void 0;
|
|
2040
|
-
var publicContext = void 0;
|
|
2041
|
-
var inst = void 0,
|
|
2042
|
-
queue = void 0,
|
|
2043
|
-
replace = void 0;
|
|
2044
|
-
var updater = void 0;
|
|
2045
|
-
|
|
2046
|
-
var initialState = void 0;
|
|
2047
|
-
var oldQueue = void 0,
|
|
2048
|
-
oldReplace = void 0;
|
|
2049
|
-
var nextState = void 0,
|
|
2050
|
-
dontMutate = void 0;
|
|
2051
|
-
var partial = void 0,
|
|
2052
|
-
partialState = void 0;
|
|
2053
|
-
|
|
2054
|
-
var childContext = void 0;
|
|
2055
|
-
var childContextTypes = void 0,
|
|
2056
|
-
contextKey = void 0;
|
|
2057
|
-
|
|
2058
2054
|
while (React.isValidElement(child)) {
|
|
2059
2055
|
// Safe because we just checked it's an element.
|
|
2060
|
-
element = child;
|
|
2056
|
+
var element = child;
|
|
2057
|
+
var Component = element.type;
|
|
2061
2058
|
{
|
|
2062
2059
|
pushElementToDebugStack(element);
|
|
2063
2060
|
}
|
|
2064
|
-
Component = element.type;
|
|
2065
2061
|
if (typeof Component !== 'function') {
|
|
2066
2062
|
break;
|
|
2067
2063
|
}
|
|
2068
|
-
|
|
2064
|
+
processChild(element, Component);
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
// Extra closure so queue and replace can be captured properly
|
|
2068
|
+
function processChild(element, Component) {
|
|
2069
|
+
var publicContext = processContext(Component, context);
|
|
2069
2070
|
|
|
2070
|
-
queue = [];
|
|
2071
|
-
replace = false;
|
|
2072
|
-
updater = {
|
|
2071
|
+
var queue = [];
|
|
2072
|
+
var replace = false;
|
|
2073
|
+
var updater = {
|
|
2073
2074
|
isMounted: function (publicInstance) {
|
|
2074
2075
|
return false;
|
|
2075
2076
|
},
|
|
@@ -2092,6 +2093,7 @@ function resolve(child, context) {
|
|
|
2092
2093
|
}
|
|
2093
2094
|
};
|
|
2094
2095
|
|
|
2096
|
+
var inst = void 0;
|
|
2095
2097
|
if (shouldConstruct(Component)) {
|
|
2096
2098
|
inst = new Component(element.props, publicContext, updater);
|
|
2097
2099
|
|
|
@@ -2106,7 +2108,7 @@ function resolve(child, context) {
|
|
|
2106
2108
|
}
|
|
2107
2109
|
}
|
|
2108
2110
|
|
|
2109
|
-
partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2111
|
+
var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
|
2110
2112
|
|
|
2111
2113
|
{
|
|
2112
2114
|
if (partialState === undefined) {
|
|
@@ -2137,7 +2139,7 @@ function resolve(child, context) {
|
|
|
2137
2139
|
if (inst == null || inst.render == null) {
|
|
2138
2140
|
child = inst;
|
|
2139
2141
|
validateRenderResult(child, Component);
|
|
2140
|
-
|
|
2142
|
+
return;
|
|
2141
2143
|
}
|
|
2142
2144
|
}
|
|
2143
2145
|
|
|
@@ -2145,7 +2147,7 @@ function resolve(child, context) {
|
|
|
2145
2147
|
inst.context = publicContext;
|
|
2146
2148
|
inst.updater = updater;
|
|
2147
2149
|
|
|
2148
|
-
initialState = inst.state;
|
|
2150
|
+
var initialState = inst.state;
|
|
2149
2151
|
if (initialState === undefined) {
|
|
2150
2152
|
inst.state = initialState = null;
|
|
2151
2153
|
}
|
|
@@ -2174,25 +2176,25 @@ function resolve(child, context) {
|
|
|
2174
2176
|
inst.UNSAFE_componentWillMount();
|
|
2175
2177
|
}
|
|
2176
2178
|
if (queue.length) {
|
|
2177
|
-
oldQueue = queue;
|
|
2178
|
-
oldReplace = replace;
|
|
2179
|
+
var oldQueue = queue;
|
|
2180
|
+
var oldReplace = replace;
|
|
2179
2181
|
queue = null;
|
|
2180
2182
|
replace = false;
|
|
2181
2183
|
|
|
2182
2184
|
if (oldReplace && oldQueue.length === 1) {
|
|
2183
2185
|
inst.state = oldQueue[0];
|
|
2184
2186
|
} else {
|
|
2185
|
-
nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2186
|
-
dontMutate = true;
|
|
2187
|
+
var nextState = oldReplace ? oldQueue[0] : inst.state;
|
|
2188
|
+
var dontMutate = true;
|
|
2187
2189
|
for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
|
2188
|
-
partial = oldQueue[i];
|
|
2189
|
-
|
|
2190
|
-
if (
|
|
2190
|
+
var partial = oldQueue[i];
|
|
2191
|
+
var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
|
2192
|
+
if (_partialState != null) {
|
|
2191
2193
|
if (dontMutate) {
|
|
2192
2194
|
dontMutate = false;
|
|
2193
|
-
nextState = _assign({}, nextState,
|
|
2195
|
+
nextState = _assign({}, nextState, _partialState);
|
|
2194
2196
|
} else {
|
|
2195
|
-
_assign(nextState,
|
|
2197
|
+
_assign(nextState, _partialState);
|
|
2196
2198
|
}
|
|
2197
2199
|
}
|
|
2198
2200
|
}
|
|
@@ -2213,11 +2215,12 @@ function resolve(child, context) {
|
|
|
2213
2215
|
}
|
|
2214
2216
|
validateRenderResult(child, Component);
|
|
2215
2217
|
|
|
2218
|
+
var childContext = void 0;
|
|
2216
2219
|
if (typeof inst.getChildContext === 'function') {
|
|
2217
|
-
childContextTypes = Component.childContextTypes;
|
|
2220
|
+
var childContextTypes = Component.childContextTypes;
|
|
2218
2221
|
if (typeof childContextTypes === 'object') {
|
|
2219
2222
|
childContext = inst.getChildContext();
|
|
2220
|
-
for (contextKey in childContext) {
|
|
2223
|
+
for (var contextKey in childContext) {
|
|
2221
2224
|
!(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
|
|
2222
2225
|
}
|
|
2223
2226
|
} else {
|
|
@@ -2266,23 +2269,23 @@ var ReactDOMServerRenderer = function () {
|
|
|
2266
2269
|
ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
|
2267
2270
|
this.providerIndex += 1;
|
|
2268
2271
|
this.providerStack[this.providerIndex] = provider;
|
|
2269
|
-
var context = provider.type.
|
|
2270
|
-
context.
|
|
2272
|
+
var context = provider.type._context;
|
|
2273
|
+
context._currentValue = provider.props.value;
|
|
2271
2274
|
};
|
|
2272
2275
|
|
|
2273
2276
|
ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
|
2274
2277
|
{
|
|
2275
|
-
|
|
2278
|
+
!(this.providerIndex > -1 && provider === this.providerStack[this.providerIndex]) ? warning(false, 'Unexpected pop.') : void 0;
|
|
2276
2279
|
}
|
|
2277
2280
|
this.providerStack[this.providerIndex] = null;
|
|
2278
2281
|
this.providerIndex -= 1;
|
|
2279
|
-
var context = provider.type.
|
|
2282
|
+
var context = provider.type._context;
|
|
2280
2283
|
if (this.providerIndex < 0) {
|
|
2281
|
-
context.
|
|
2284
|
+
context._currentValue = context._defaultValue;
|
|
2282
2285
|
} else {
|
|
2283
2286
|
// We assume this type is correct because of the index check above.
|
|
2284
2287
|
var previousProvider = this.providerStack[this.providerIndex];
|
|
2285
|
-
context.
|
|
2288
|
+
context._currentValue = previousProvider.props.value;
|
|
2286
2289
|
}
|
|
2287
2290
|
};
|
|
2288
2291
|
|
|
@@ -2384,6 +2387,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2384
2387
|
switch (elementType) {
|
|
2385
2388
|
case REACT_STRICT_MODE_TYPE:
|
|
2386
2389
|
case REACT_ASYNC_MODE_TYPE:
|
|
2390
|
+
case REACT_PROFILER_TYPE:
|
|
2387
2391
|
case REACT_FRAGMENT_TYPE:
|
|
2388
2392
|
{
|
|
2389
2393
|
var _nextChildren = toArray(nextChild.props.children);
|
|
@@ -2401,56 +2405,71 @@ var ReactDOMServerRenderer = function () {
|
|
|
2401
2405
|
this.stack.push(_frame);
|
|
2402
2406
|
return '';
|
|
2403
2407
|
}
|
|
2404
|
-
case REACT_CALL_TYPE:
|
|
2405
|
-
case REACT_RETURN_TYPE:
|
|
2406
|
-
invariant(false, 'The experimental Call and Return types are not currently supported by the server renderer.');
|
|
2407
2408
|
// eslint-disable-next-line-no-fallthrough
|
|
2408
2409
|
default:
|
|
2409
2410
|
break;
|
|
2410
2411
|
}
|
|
2411
2412
|
if (typeof elementType === 'object' && elementType !== null) {
|
|
2412
2413
|
switch (elementType.$$typeof) {
|
|
2414
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2415
|
+
{
|
|
2416
|
+
var element = nextChild;
|
|
2417
|
+
var _nextChildren2 = toArray(elementType.render(element.props, element.ref));
|
|
2418
|
+
var _frame2 = {
|
|
2419
|
+
type: null,
|
|
2420
|
+
domNamespace: parentNamespace,
|
|
2421
|
+
children: _nextChildren2,
|
|
2422
|
+
childIndex: 0,
|
|
2423
|
+
context: context,
|
|
2424
|
+
footer: ''
|
|
2425
|
+
};
|
|
2426
|
+
{
|
|
2427
|
+
_frame2.debugElementStack = [];
|
|
2428
|
+
}
|
|
2429
|
+
this.stack.push(_frame2);
|
|
2430
|
+
return '';
|
|
2431
|
+
}
|
|
2413
2432
|
case REACT_PROVIDER_TYPE:
|
|
2414
2433
|
{
|
|
2415
2434
|
var provider = nextChild;
|
|
2416
2435
|
var nextProps = provider.props;
|
|
2417
|
-
var
|
|
2418
|
-
var
|
|
2436
|
+
var _nextChildren3 = toArray(nextProps.children);
|
|
2437
|
+
var _frame3 = {
|
|
2419
2438
|
type: provider,
|
|
2420
2439
|
domNamespace: parentNamespace,
|
|
2421
|
-
children:
|
|
2440
|
+
children: _nextChildren3,
|
|
2422
2441
|
childIndex: 0,
|
|
2423
2442
|
context: context,
|
|
2424
2443
|
footer: ''
|
|
2425
2444
|
};
|
|
2426
2445
|
{
|
|
2427
|
-
|
|
2446
|
+
_frame3.debugElementStack = [];
|
|
2428
2447
|
}
|
|
2429
2448
|
|
|
2430
2449
|
this.pushProvider(provider);
|
|
2431
2450
|
|
|
2432
|
-
this.stack.push(
|
|
2451
|
+
this.stack.push(_frame3);
|
|
2433
2452
|
return '';
|
|
2434
2453
|
}
|
|
2435
2454
|
case REACT_CONTEXT_TYPE:
|
|
2436
2455
|
{
|
|
2437
2456
|
var consumer = nextChild;
|
|
2438
2457
|
var _nextProps = consumer.props;
|
|
2439
|
-
var nextValue = consumer.type.
|
|
2458
|
+
var nextValue = consumer.type._currentValue;
|
|
2440
2459
|
|
|
2441
|
-
var
|
|
2442
|
-
var
|
|
2460
|
+
var _nextChildren4 = toArray(_nextProps.children(nextValue));
|
|
2461
|
+
var _frame4 = {
|
|
2443
2462
|
type: nextChild,
|
|
2444
2463
|
domNamespace: parentNamespace,
|
|
2445
|
-
children:
|
|
2464
|
+
children: _nextChildren4,
|
|
2446
2465
|
childIndex: 0,
|
|
2447
2466
|
context: context,
|
|
2448
2467
|
footer: ''
|
|
2449
2468
|
};
|
|
2450
2469
|
{
|
|
2451
|
-
|
|
2470
|
+
_frame4.debugElementStack = [];
|
|
2452
2471
|
}
|
|
2453
|
-
this.stack.push(
|
|
2472
|
+
this.stack.push(_frame4);
|
|
2454
2473
|
return '';
|
|
2455
2474
|
}
|
|
2456
2475
|
default:
|
|
@@ -2485,7 +2504,7 @@ var ReactDOMServerRenderer = function () {
|
|
|
2485
2504
|
if (namespace === Namespaces.html) {
|
|
2486
2505
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
2487
2506
|
// allow <SVG> or <mATH>.
|
|
2488
|
-
|
|
2507
|
+
!(tag === element.type) ? warning(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
|
|
2489
2508
|
}
|
|
2490
2509
|
}
|
|
2491
2510
|
|
|
@@ -2561,9 +2580,11 @@ var ReactDOMServerRenderer = function () {
|
|
|
2561
2580
|
}
|
|
2562
2581
|
var isArray = Array.isArray(props[propName]);
|
|
2563
2582
|
if (props.multiple && !isArray) {
|
|
2564
|
-
warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '')
|
|
2583
|
+
warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, '' // getDeclarationErrorAddendum(),
|
|
2584
|
+
);
|
|
2565
2585
|
} else if (!props.multiple && isArray) {
|
|
2566
|
-
warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '')
|
|
2586
|
+
warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, '' // getDeclarationErrorAddendum(),
|
|
2587
|
+
);
|
|
2567
2588
|
}
|
|
2568
2589
|
}
|
|
2569
2590
|
|
|
@@ -2756,7 +2777,7 @@ var ReactDOMServer = ( ReactDOMServerNode$1 && ReactDOMServerNode ) || ReactDOMS
|
|
|
2756
2777
|
|
|
2757
2778
|
// TODO: decide on the top-level export form.
|
|
2758
2779
|
// This is hacky but makes it work with both Rollup and Jest
|
|
2759
|
-
var server_node = ReactDOMServer
|
|
2780
|
+
var server_node = ReactDOMServer.default ? ReactDOMServer.default : ReactDOMServer;
|
|
2760
2781
|
|
|
2761
2782
|
module.exports = server_node;
|
|
2762
2783
|
})();
|