react-dom 16.3.1 → 16.3.2
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 +7 -11
- package/cjs/react-dom-server.browser.production.min.js +25 -25
- package/cjs/react-dom-server.node.development.js +8 -12
- package/cjs/react-dom-server.node.production.min.js +27 -27
- package/cjs/react-dom-test-utils.development.js +6 -10
- package/cjs/react-dom-test-utils.production.min.js +25 -25
- package/cjs/react-dom-unstable-native-dependencies.development.js +10 -14
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +27 -27
- package/cjs/react-dom.development.js +97 -67
- package/cjs/react-dom.production.min.js +201 -200
- package/package.json +1 -1
- package/umd/react-dom-server.browser.development.js +11 -15
- package/umd/react-dom-server.browser.production.min.js +24 -23
- package/umd/react-dom-test-utils.development.js +6 -10
- package/umd/react-dom-test-utils.production.min.js +22 -22
- package/umd/react-dom-unstable-native-dependencies.development.js +11 -15
- package/umd/react-dom-unstable-native-dependencies.production.min.js +23 -23
- package/umd/react-dom.development.js +97 -67
- package/umd/react-dom.production.min.js +195 -195
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.3.
|
|
1
|
+
/** @license React v16.3.2
|
|
2
2
|
* react-dom.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -15,8 +15,8 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
15
15
|
(function() {
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
-
var React = require('react');
|
|
19
18
|
var invariant = require('fbjs/lib/invariant');
|
|
19
|
+
var React = require('react');
|
|
20
20
|
var warning = require('fbjs/lib/warning');
|
|
21
21
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
22
22
|
var _assign = require('object-assign');
|
|
@@ -29,12 +29,8 @@ var emptyObject = require('fbjs/lib/emptyObject');
|
|
|
29
29
|
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
|
|
30
30
|
var camelizeStyleName = require('fbjs/lib/camelizeStyleName');
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* This is a replacement for `invariant(...)` used by the error code system
|
|
35
|
-
* and will _only_ be required by the corresponding babel pass.
|
|
36
|
-
* It always throws.
|
|
37
|
-
*/
|
|
32
|
+
// Relying on the `invariant()` implementation lets us
|
|
33
|
+
// have preserve the format and params in the www builds.
|
|
38
34
|
|
|
39
35
|
!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;
|
|
40
36
|
|
|
@@ -431,7 +427,7 @@ var injection$1 = {
|
|
|
431
427
|
getNodeFromInstance = Injected.getNodeFromInstance;
|
|
432
428
|
|
|
433
429
|
{
|
|
434
|
-
|
|
430
|
+
!(getNodeFromInstance && getInstanceFromNode) ? warning(false, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
|
|
435
431
|
}
|
|
436
432
|
}
|
|
437
433
|
};
|
|
@@ -453,7 +449,7 @@ var validateEventDispatches = void 0;
|
|
|
453
449
|
var instancesIsArr = Array.isArray(dispatchInstances);
|
|
454
450
|
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
|
455
451
|
|
|
456
|
-
|
|
452
|
+
!(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warning(false, 'EventPluginUtils: Invalid `event`.') : void 0;
|
|
457
453
|
};
|
|
458
454
|
}
|
|
459
455
|
|
|
@@ -1006,7 +1002,7 @@ function listenerAtPhase(inst, event, propagationPhase) {
|
|
|
1006
1002
|
*/
|
|
1007
1003
|
function accumulateDirectionalDispatches(inst, phase, event) {
|
|
1008
1004
|
{
|
|
1009
|
-
warning(
|
|
1005
|
+
!inst ? warning(false, 'Dispatching inst must not be null') : void 0;
|
|
1010
1006
|
}
|
|
1011
1007
|
var listener = listenerAtPhase(inst, event, phase);
|
|
1012
1008
|
if (listener) {
|
|
@@ -1376,7 +1372,7 @@ SyntheticEvent.extend = function (Interface) {
|
|
|
1376
1372
|
return new Proxy(constructor.apply(that, args), {
|
|
1377
1373
|
set: function (target, prop, value) {
|
|
1378
1374
|
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
1379
|
-
|
|
1375
|
+
!(didWarnForAddedNewProperty || target.isPersistent()) ? warning(false, "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
|
1380
1376
|
didWarnForAddedNewProperty = true;
|
|
1381
1377
|
}
|
|
1382
1378
|
target[prop] = value;
|
|
@@ -1421,7 +1417,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
|
1421
1417
|
|
|
1422
1418
|
function warn(action, result) {
|
|
1423
1419
|
var warningCondition = false;
|
|
1424
|
-
warning(
|
|
1420
|
+
!warningCondition ? warning(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
|
1425
1421
|
}
|
|
1426
1422
|
}
|
|
1427
1423
|
|
|
@@ -2231,6 +2227,13 @@ function getComponentName(fiber) {
|
|
|
2231
2227
|
case REACT_RETURN_TYPE:
|
|
2232
2228
|
return 'ReactReturn';
|
|
2233
2229
|
}
|
|
2230
|
+
if (typeof type === 'object' && type !== null) {
|
|
2231
|
+
switch (type.$$typeof) {
|
|
2232
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2233
|
+
var functionName = type.render.displayName || type.render.name || '';
|
|
2234
|
+
return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2234
2237
|
return null;
|
|
2235
2238
|
}
|
|
2236
2239
|
|
|
@@ -3489,7 +3492,7 @@ function isMounted(component) {
|
|
|
3489
3492
|
if (owner !== null && owner.tag === ClassComponent) {
|
|
3490
3493
|
var ownerFiber = owner;
|
|
3491
3494
|
var instance = ownerFiber.stateNode;
|
|
3492
|
-
|
|
3495
|
+
!instance._warnedAboutRefsInRender ? warning(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber) || 'A component') : void 0;
|
|
3493
3496
|
instance._warnedAboutRefsInRender = true;
|
|
3494
3497
|
}
|
|
3495
3498
|
}
|
|
@@ -5629,6 +5632,14 @@ var ReactStrictModeWarnings = {
|
|
|
5629
5632
|
var didWarnAboutDeprecatedLifecycles = new Set();
|
|
5630
5633
|
var didWarnAboutUnsafeLifecycles = new Set();
|
|
5631
5634
|
|
|
5635
|
+
var setToSortedString = function (set) {
|
|
5636
|
+
var array = [];
|
|
5637
|
+
set.forEach(function (value) {
|
|
5638
|
+
array.push(value);
|
|
5639
|
+
});
|
|
5640
|
+
return array.sort().join(', ');
|
|
5641
|
+
};
|
|
5642
|
+
|
|
5632
5643
|
ReactStrictModeWarnings.discardPendingWarnings = function () {
|
|
5633
5644
|
pendingComponentWillMountWarnings = [];
|
|
5634
5645
|
pendingComponentWillReceivePropsWarnings = [];
|
|
@@ -5651,7 +5662,7 @@ var ReactStrictModeWarnings = {
|
|
|
5651
5662
|
|
|
5652
5663
|
var formatted = lifecycle.replace('UNSAFE_', '');
|
|
5653
5664
|
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
|
5654
|
-
var sortedComponentNames =
|
|
5665
|
+
var sortedComponentNames = setToSortedString(componentNames);
|
|
5655
5666
|
|
|
5656
5667
|
lifecyclesWarningMesages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames));
|
|
5657
5668
|
}
|
|
@@ -5689,7 +5700,7 @@ var ReactStrictModeWarnings = {
|
|
|
5689
5700
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
|
5690
5701
|
});
|
|
5691
5702
|
|
|
5692
|
-
var sortedNames =
|
|
5703
|
+
var sortedNames = setToSortedString(uniqueNames);
|
|
5693
5704
|
|
|
5694
5705
|
lowPriorityWarning$1(false, 'componentWillMount is deprecated and will be removed in the next major version. ' + 'Use componentDidMount instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillMount.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', sortedNames);
|
|
5695
5706
|
|
|
@@ -5703,7 +5714,7 @@ var ReactStrictModeWarnings = {
|
|
|
5703
5714
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
|
5704
5715
|
});
|
|
5705
5716
|
|
|
5706
|
-
var _sortedNames =
|
|
5717
|
+
var _sortedNames = setToSortedString(_uniqueNames);
|
|
5707
5718
|
|
|
5708
5719
|
lowPriorityWarning$1(false, 'componentWillReceiveProps is deprecated and will be removed in the next major version. ' + 'Use static getDerivedStateFromProps instead.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames);
|
|
5709
5720
|
|
|
@@ -5717,7 +5728,7 @@ var ReactStrictModeWarnings = {
|
|
|
5717
5728
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
|
5718
5729
|
});
|
|
5719
5730
|
|
|
5720
|
-
var _sortedNames2 =
|
|
5731
|
+
var _sortedNames2 = setToSortedString(_uniqueNames2);
|
|
5721
5732
|
|
|
5722
5733
|
lowPriorityWarning$1(false, 'componentWillUpdate is deprecated and will be removed in the next major version. ' + 'Use componentDidUpdate instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillUpdate.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames2);
|
|
5723
5734
|
|
|
@@ -5951,6 +5962,7 @@ var shouldIgnoreFiber = function (fiber) {
|
|
|
5951
5962
|
case Fragment:
|
|
5952
5963
|
case ContextProvider:
|
|
5953
5964
|
case ContextConsumer:
|
|
5965
|
+
case Mode:
|
|
5954
5966
|
return true;
|
|
5955
5967
|
default:
|
|
5956
5968
|
return false;
|
|
@@ -6685,7 +6697,7 @@ var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExp
|
|
|
6685
6697
|
stopPhaseTimer();
|
|
6686
6698
|
|
|
6687
6699
|
{
|
|
6688
|
-
|
|
6700
|
+
!(shouldUpdate !== undefined) ? warning(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component') : void 0;
|
|
6689
6701
|
}
|
|
6690
6702
|
|
|
6691
6703
|
return shouldUpdate;
|
|
@@ -6714,48 +6726,48 @@ var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExp
|
|
|
6714
6726
|
}
|
|
6715
6727
|
|
|
6716
6728
|
var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
|
|
6717
|
-
warning(
|
|
6729
|
+
!noGetInitialStateOnES6 ? warning(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
|
|
6718
6730
|
var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
|
|
6719
|
-
warning(
|
|
6731
|
+
!noGetDefaultPropsOnES6 ? warning(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
|
|
6720
6732
|
var noInstancePropTypes = !instance.propTypes;
|
|
6721
|
-
warning(
|
|
6733
|
+
!noInstancePropTypes ? warning(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
|
|
6722
6734
|
var noInstanceContextTypes = !instance.contextTypes;
|
|
6723
|
-
warning(
|
|
6735
|
+
!noInstanceContextTypes ? warning(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
|
|
6724
6736
|
var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
|
|
6725
|
-
warning(
|
|
6737
|
+
!noComponentShouldUpdate ? warning(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
|
|
6726
6738
|
if (type.prototype && type.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
|
|
6727
6739
|
warning(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(workInProgress) || 'A pure component');
|
|
6728
6740
|
}
|
|
6729
6741
|
var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
|
|
6730
|
-
warning(
|
|
6742
|
+
!noComponentDidUnmount ? warning(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
|
|
6731
6743
|
var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
|
|
6732
|
-
warning(
|
|
6744
|
+
!noComponentDidReceiveProps ? warning(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
|
|
6733
6745
|
var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
|
|
6734
|
-
warning(
|
|
6746
|
+
!noComponentWillRecieveProps ? warning(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
|
|
6735
6747
|
var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
|
|
6736
|
-
warning(
|
|
6748
|
+
!noUnsafeComponentWillRecieveProps ? warning(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
|
|
6737
6749
|
var hasMutatedProps = instance.props !== workInProgress.pendingProps;
|
|
6738
|
-
|
|
6750
|
+
!(instance.props === undefined || !hasMutatedProps) ? warning(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
|
|
6739
6751
|
var noInstanceDefaultProps = !instance.defaultProps;
|
|
6740
|
-
warning(
|
|
6752
|
+
!noInstanceDefaultProps ? warning(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;
|
|
6741
6753
|
|
|
6742
|
-
if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' &&
|
|
6754
|
+
if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)) {
|
|
6743
6755
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
|
|
6744
6756
|
warning(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(workInProgress));
|
|
6745
6757
|
}
|
|
6746
6758
|
|
|
6747
6759
|
var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
|
|
6748
|
-
warning(
|
|
6760
|
+
!noInstanceGetDerivedStateFromProps ? warning(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
|
|
6749
6761
|
var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromCatch !== 'function';
|
|
6750
|
-
warning(
|
|
6762
|
+
!noInstanceGetDerivedStateFromCatch ? warning(false, '%s: getDerivedStateFromCatch() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
|
|
6751
6763
|
var noStaticGetSnapshotBeforeUpdate = typeof type.getSnapshotBeforeUpdate !== 'function';
|
|
6752
|
-
warning(
|
|
6764
|
+
!noStaticGetSnapshotBeforeUpdate ? warning(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
|
|
6753
6765
|
var _state = instance.state;
|
|
6754
6766
|
if (_state && (typeof _state !== 'object' || isArray(_state))) {
|
|
6755
6767
|
warning(false, '%s.state: must be set to an object or null', name);
|
|
6756
6768
|
}
|
|
6757
6769
|
if (typeof instance.getChildContext === 'function') {
|
|
6758
|
-
|
|
6770
|
+
!(typeof type.childContextTypes === 'object') ? warning(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
|
|
6759
6771
|
}
|
|
6760
6772
|
}
|
|
6761
6773
|
}
|
|
@@ -7855,7 +7867,7 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
7855
7867
|
if (typeof newChildrenIterable.entries === 'function') {
|
|
7856
7868
|
var possibleMap = newChildrenIterable;
|
|
7857
7869
|
if (possibleMap.entries === iteratorFn) {
|
|
7858
|
-
warning(
|
|
7870
|
+
!didWarnAboutMaps ? warning(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$2()) : void 0;
|
|
7859
7871
|
didWarnAboutMaps = true;
|
|
7860
7872
|
}
|
|
7861
7873
|
}
|
|
@@ -8594,7 +8606,7 @@ var ReactFiberBeginWork = function (config, hostContext, legacyContext, newConte
|
|
|
8594
8606
|
var _Component = workInProgress.type;
|
|
8595
8607
|
|
|
8596
8608
|
if (_Component) {
|
|
8597
|
-
|
|
8609
|
+
!!_Component.childContextTypes ? warning(false, '%s(...): childContextTypes cannot be defined on a functional component.', _Component.displayName || _Component.name || 'Component') : void 0;
|
|
8598
8610
|
}
|
|
8599
8611
|
if (workInProgress.ref !== null) {
|
|
8600
8612
|
var info = '';
|
|
@@ -8807,7 +8819,7 @@ var ReactFiberBeginWork = function (config, hostContext, legacyContext, newConte
|
|
|
8807
8819
|
} else {
|
|
8808
8820
|
changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
8809
8821
|
{
|
|
8810
|
-
|
|
8822
|
+
!((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits) ? warning(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
|
|
8811
8823
|
}
|
|
8812
8824
|
changedBits |= 0;
|
|
8813
8825
|
|
|
@@ -8861,6 +8873,10 @@ var ReactFiberBeginWork = function (config, hostContext, legacyContext, newConte
|
|
|
8861
8873
|
// Context change propagation stops at matching consumers, for time-
|
|
8862
8874
|
// slicing. Continue the propagation here.
|
|
8863
8875
|
propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
|
|
8876
|
+
} else if (oldProps === newProps) {
|
|
8877
|
+
// Skip over a memoized parent with a bitmask bailout even
|
|
8878
|
+
// if we began working on it because of a deeper matching child.
|
|
8879
|
+
return bailoutOnAlreadyFinishedWork(current, workInProgress);
|
|
8864
8880
|
}
|
|
8865
8881
|
// There is no bailout on `children` equality because we expect people
|
|
8866
8882
|
// to often pass a bound method as a child, but it may reference
|
|
@@ -8869,7 +8885,7 @@ var ReactFiberBeginWork = function (config, hostContext, legacyContext, newConte
|
|
|
8869
8885
|
var render = newProps.children;
|
|
8870
8886
|
|
|
8871
8887
|
{
|
|
8872
|
-
|
|
8888
|
+
!(typeof render === 'function') ? warning(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
|
|
8873
8889
|
}
|
|
8874
8890
|
|
|
8875
8891
|
var newChildren = render(newValue);
|
|
@@ -9024,7 +9040,7 @@ var ReactFiberCompleteWork = function (config, hostContext, legacyContext, newCo
|
|
|
9024
9040
|
|
|
9025
9041
|
function markUpdate(workInProgress) {
|
|
9026
9042
|
// Tag the fiber with an update effect. This turns a Placement into
|
|
9027
|
-
//
|
|
9043
|
+
// a PlacementAndUpdate.
|
|
9028
9044
|
workInProgress.effectTag |= Update;
|
|
9029
9045
|
}
|
|
9030
9046
|
|
|
@@ -11037,7 +11053,7 @@ var ReactFiberNewContext = function (stack) {
|
|
|
11037
11053
|
context._changedBits = providerFiber.stateNode;
|
|
11038
11054
|
|
|
11039
11055
|
{
|
|
11040
|
-
|
|
11056
|
+
!(context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warning(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
|
|
11041
11057
|
context._currentRenderer = rendererSigil;
|
|
11042
11058
|
}
|
|
11043
11059
|
}
|
|
@@ -11987,8 +12003,19 @@ var ReactFiberScheduler = function (config) {
|
|
|
11987
12003
|
}
|
|
11988
12004
|
|
|
11989
12005
|
function computeInteractiveExpiration(currentTime) {
|
|
11990
|
-
|
|
11991
|
-
|
|
12006
|
+
var expirationMs = void 0;
|
|
12007
|
+
// We intentionally set a higher expiration time for interactive updates in
|
|
12008
|
+
// dev than in production.
|
|
12009
|
+
// If the main thread is being blocked so long that you hit the expiration,
|
|
12010
|
+
// it's a problem that could be solved with better scheduling.
|
|
12011
|
+
// People will be more likely to notice this and fix it with the long
|
|
12012
|
+
// expiration time in development.
|
|
12013
|
+
// In production we opt for better UX at the risk of masking scheduling
|
|
12014
|
+
// problems, by expiring fast.
|
|
12015
|
+
{
|
|
12016
|
+
// Should complete within ~500ms. 600ms max.
|
|
12017
|
+
expirationMs = 500;
|
|
12018
|
+
}
|
|
11992
12019
|
var bucketSizeMs = 100;
|
|
11993
12020
|
return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);
|
|
11994
12021
|
}
|
|
@@ -12667,7 +12694,7 @@ var ReactFiberReconciler$1 = function (config) {
|
|
|
12667
12694
|
|
|
12668
12695
|
callback = callback === undefined ? null : callback;
|
|
12669
12696
|
{
|
|
12670
|
-
|
|
12697
|
+
!(callback === null || typeof callback === 'function') ? warning(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
|
|
12671
12698
|
}
|
|
12672
12699
|
|
|
12673
12700
|
var update = {
|
|
@@ -12711,7 +12738,15 @@ var ReactFiberReconciler$1 = function (config) {
|
|
|
12711
12738
|
return scheduleRootUpdate(current, element, currentTime, expirationTime, callback);
|
|
12712
12739
|
}
|
|
12713
12740
|
|
|
12714
|
-
function findHostInstance(
|
|
12741
|
+
function findHostInstance(component) {
|
|
12742
|
+
var fiber = get(component);
|
|
12743
|
+
if (fiber === undefined) {
|
|
12744
|
+
if (typeof component.render === 'function') {
|
|
12745
|
+
invariant(false, 'Unable to find node on an unmounted component.');
|
|
12746
|
+
} else {
|
|
12747
|
+
invariant(false, 'Argument appears to not be a ReactComponent. Keys: %s', Object.keys(component));
|
|
12748
|
+
}
|
|
12749
|
+
}
|
|
12715
12750
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
12716
12751
|
if (hostFiber === null) {
|
|
12717
12752
|
return null;
|
|
@@ -12785,7 +12820,11 @@ var ReactFiberReconciler$1 = function (config) {
|
|
|
12785
12820
|
|
|
12786
12821
|
return injectInternals(_assign({}, devToolsConfig, {
|
|
12787
12822
|
findHostInstanceByFiber: function (fiber) {
|
|
12788
|
-
|
|
12823
|
+
var hostFiber = findCurrentHostFiber(fiber);
|
|
12824
|
+
if (hostFiber === null) {
|
|
12825
|
+
return null;
|
|
12826
|
+
}
|
|
12827
|
+
return hostFiber.stateNode;
|
|
12789
12828
|
},
|
|
12790
12829
|
findFiberByHostInstance: function (instance) {
|
|
12791
12830
|
if (!findFiberByHostInstance) {
|
|
@@ -12830,7 +12869,7 @@ implementation) {
|
|
|
12830
12869
|
|
|
12831
12870
|
// TODO: this is special because it gets imported during build.
|
|
12832
12871
|
|
|
12833
|
-
var ReactVersion = '16.3.
|
|
12872
|
+
var ReactVersion = '16.3.2';
|
|
12834
12873
|
|
|
12835
12874
|
// a requestAnimationFrame, storing the time for the start of the frame, then
|
|
12836
12875
|
// scheduling a postMessage which gets scheduled after paint. Within the
|
|
@@ -13748,7 +13787,7 @@ function assertValidProps(tag, props, getStack) {
|
|
|
13748
13787
|
!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 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;
|
|
13749
13788
|
}
|
|
13750
13789
|
{
|
|
13751
|
-
|
|
13790
|
+
!(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;
|
|
13752
13791
|
}
|
|
13753
13792
|
!(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;
|
|
13754
13793
|
}
|
|
@@ -14811,7 +14850,7 @@ function createElement$1(type, props, rootContainerElement, parentNamespace) {
|
|
|
14811
14850
|
isCustomComponentTag = isCustomComponent(type, props);
|
|
14812
14851
|
// Should this check be gated by parent namespace? Not sure we want to
|
|
14813
14852
|
// allow <SVG> or <mATH>.
|
|
14814
|
-
|
|
14853
|
+
!(isCustomComponentTag || type === type.toLowerCase()) ? warning(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
|
|
14815
14854
|
}
|
|
14816
14855
|
|
|
14817
14856
|
if (type === 'script') {
|
|
@@ -15764,7 +15803,7 @@ var validateDOMNesting = emptyFunction;
|
|
|
15764
15803
|
var parentTag = parentInfo && parentInfo.tag;
|
|
15765
15804
|
|
|
15766
15805
|
if (childText != null) {
|
|
15767
|
-
|
|
15806
|
+
!(childTag == null) ? warning(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
|
|
15768
15807
|
childTag = '#text';
|
|
15769
15808
|
}
|
|
15770
15809
|
|
|
@@ -15850,7 +15889,7 @@ var didWarnAboutUnstableCreatePortal = false;
|
|
|
15850
15889
|
if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
|
|
15851
15890
|
var hostInstance = DOMRenderer.findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
|
|
15852
15891
|
if (hostInstance) {
|
|
15853
|
-
|
|
15892
|
+
!(hostInstance.parentNode === container) ? warning(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
|
|
15854
15893
|
}
|
|
15855
15894
|
}
|
|
15856
15895
|
|
|
@@ -15858,13 +15897,13 @@ var didWarnAboutUnstableCreatePortal = false;
|
|
|
15858
15897
|
var rootEl = getReactRootElementInContainer(container);
|
|
15859
15898
|
var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
|
|
15860
15899
|
|
|
15861
|
-
|
|
15900
|
+
!(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warning(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
|
|
15862
15901
|
|
|
15863
|
-
|
|
15902
|
+
!(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warning(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
|
|
15864
15903
|
};
|
|
15865
15904
|
|
|
15866
15905
|
warnOnInvalidCallback = function (callback, callerName) {
|
|
15867
|
-
|
|
15906
|
+
!(callback === null || typeof callback === 'function') ? warning(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
|
|
15868
15907
|
};
|
|
15869
15908
|
}
|
|
15870
15909
|
|
|
@@ -16483,7 +16522,7 @@ var ReactDOM = {
|
|
|
16483
16522
|
var owner = ReactCurrentOwner.current;
|
|
16484
16523
|
if (owner !== null && owner.stateNode !== null) {
|
|
16485
16524
|
var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
|
|
16486
|
-
warning(
|
|
16525
|
+
!warnedAboutRefsInRender ? warning(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner) || 'A component') : void 0;
|
|
16487
16526
|
owner.stateNode._warnedAboutRefsInRender = true;
|
|
16488
16527
|
}
|
|
16489
16528
|
}
|
|
@@ -16494,16 +16533,7 @@ var ReactDOM = {
|
|
|
16494
16533
|
return componentOrElement;
|
|
16495
16534
|
}
|
|
16496
16535
|
|
|
16497
|
-
|
|
16498
|
-
if (inst) {
|
|
16499
|
-
return DOMRenderer.findHostInstance(inst);
|
|
16500
|
-
}
|
|
16501
|
-
|
|
16502
|
-
if (typeof componentOrElement.render === 'function') {
|
|
16503
|
-
invariant(false, 'Unable to find node on an unmounted component.');
|
|
16504
|
-
} else {
|
|
16505
|
-
invariant(false, 'Element appears to be neither ReactComponent nor DOMNode. Keys: %s', Object.keys(componentOrElement));
|
|
16506
|
-
}
|
|
16536
|
+
return DOMRenderer.findHostInstance(componentOrElement);
|
|
16507
16537
|
},
|
|
16508
16538
|
hydrate: function (element, container, callback) {
|
|
16509
16539
|
// TODO: throw or warn if we couldn't hydrate?
|
|
@@ -16523,7 +16553,7 @@ var ReactDOM = {
|
|
|
16523
16553
|
{
|
|
16524
16554
|
var rootEl = getReactRootElementInContainer(container);
|
|
16525
16555
|
var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
|
|
16526
|
-
warning(
|
|
16556
|
+
!!renderedByDifferentReact ? warning(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
|
|
16527
16557
|
}
|
|
16528
16558
|
|
|
16529
16559
|
// Unmount should not be batched.
|
|
@@ -16543,7 +16573,7 @@ var ReactDOM = {
|
|
|
16543
16573
|
// Check if the container itself is a React root node.
|
|
16544
16574
|
var isContainerReactRoot = container.nodeType === 1 && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
|
|
16545
16575
|
|
|
16546
|
-
warning(
|
|
16576
|
+
!!hasNonRootReactChild ? warning(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
|
|
16547
16577
|
}
|
|
16548
16578
|
|
|
16549
16579
|
return false;
|