react 15.3.0 → 15.3.1-rc.1
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/dist/react-with-addons.js +1024 -1174
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +956 -1106
- package/dist/react.min.js +6 -6
- package/lib/DOMPropertyOperations.js +0 -7
- package/lib/EventPluginHub.js +2 -0
- package/lib/ReactChildReconciler.js +11 -8
- package/lib/{ReactChildrenMutationWarningDevtool.js → ReactChildrenMutationWarningHook.js} +11 -19
- package/lib/ReactComponentBrowserEnvironment.js +1 -10
- package/lib/ReactComponentEnvironment.js +0 -8
- package/lib/ReactComponentTreeDevtool.js +2 -205
- package/lib/ReactComponentTreeHook.js +248 -0
- package/lib/ReactComponentTreeTestUtils.js +11 -11
- package/lib/ReactCompositeComponent.js +10 -34
- package/lib/ReactDOM.js +9 -0
- package/lib/ReactDOMComponent.js +21 -42
- package/lib/ReactDOMComponentTree.js +1 -1
- package/lib/ReactDOMEmptyComponent.js +1 -1
- package/lib/ReactDOMInput.js +20 -2
- package/lib/{ReactDOMNullInputValuePropDevtool.js → ReactDOMNullInputValuePropHook.js} +5 -5
- package/lib/ReactDOMSelect.js +5 -4
- package/lib/ReactDOMTextComponent.js +1 -8
- package/lib/{ReactDOMUnknownPropertyDevtool.js → ReactDOMUnknownPropertyHook.js} +8 -8
- package/lib/ReactDebugTool.js +63 -77
- package/lib/ReactElementValidator.js +5 -3
- package/lib/{ReactHostOperationHistoryDevtool.js → ReactHostOperationHistoryHook.js} +4 -4
- package/lib/{ReactInvalidSetStateWarningDevTool.js → ReactInvalidSetStateWarningHook.js} +3 -3
- package/lib/ReactMount.js +3 -7
- package/lib/ReactMultiChild.js +11 -13
- package/lib/ReactNativeBaseComponent.js +5 -3
- package/lib/ReactNativeComponentEnvironment.js +0 -7
- package/lib/ReactNativeMount.js +2 -5
- package/lib/ReactNativeTextComponent.js +2 -10
- package/lib/ReactReconciler.js +5 -11
- package/lib/ReactServerRendering.js +2 -1
- package/lib/ReactSimpleEmptyComponent.js +3 -2
- package/lib/ReactTestMount.js +0 -5
- package/lib/ReactTestUtils.js +5 -5
- package/lib/ReactVersion.js +1 -1
- package/lib/ResponderEventPlugin.js +6 -5
- package/lib/SimpleEventPlugin.js +2 -0
- package/lib/SyntheticEvent.js +8 -1
- package/lib/checkReactTypeSpec.js +6 -6
- package/lib/createReactNativeComponentClass.js +1 -1
- package/lib/flattenChildren.js +7 -5
- package/lib/instantiateReactComponent.js +1 -28
- package/package.json +1 -1
- package/lib/ReactDOMDebugTool.js +0 -67
- package/lib/ReactDOMInstrumentation.js +0 -21
- package/lib/createHierarchyRenderer.js +0 -85
|
@@ -17,23 +17,23 @@ var _extends = _assign || function (target) { for (var i = 1; i < arguments.leng
|
|
|
17
17
|
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
21
21
|
|
|
22
22
|
function getRootDisplayNames() {
|
|
23
|
-
return
|
|
23
|
+
return ReactComponentTreeHook.getRootIDs().map(ReactComponentTreeHook.getDisplayName);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function getRegisteredDisplayNames() {
|
|
27
|
-
return
|
|
27
|
+
return ReactComponentTreeHook.getRegisteredIDs().map(ReactComponentTreeHook.getDisplayName);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function expectTree(rootID, expectedTree, parentPath) {
|
|
31
|
-
var displayName =
|
|
32
|
-
var ownerID =
|
|
33
|
-
var parentID =
|
|
34
|
-
var childIDs =
|
|
35
|
-
var text =
|
|
36
|
-
var element =
|
|
31
|
+
var displayName = ReactComponentTreeHook.getDisplayName(rootID);
|
|
32
|
+
var ownerID = ReactComponentTreeHook.getOwnerID(rootID);
|
|
33
|
+
var parentID = ReactComponentTreeHook.getParentID(rootID);
|
|
34
|
+
var childIDs = ReactComponentTreeHook.getChildIDs(rootID);
|
|
35
|
+
var text = ReactComponentTreeHook.getText(rootID);
|
|
36
|
+
var element = ReactComponentTreeHook.getElement(rootID);
|
|
37
37
|
var path = parentPath ? parentPath + ' > ' + displayName : displayName;
|
|
38
38
|
|
|
39
39
|
function expectEqual(actual, expected, name) {
|
|
@@ -47,10 +47,10 @@ function expectTree(rootID, expectedTree, parentPath) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (expectedTree.parentDisplayName !== undefined) {
|
|
50
|
-
expectEqual(
|
|
50
|
+
expectEqual(ReactComponentTreeHook.getDisplayName(parentID), expectedTree.parentDisplayName, 'parentDisplayName');
|
|
51
51
|
}
|
|
52
52
|
if (expectedTree.ownerDisplayName !== undefined) {
|
|
53
|
-
expectEqual(
|
|
53
|
+
expectEqual(ReactComponentTreeHook.getDisplayName(ownerID), expectedTree.ownerDisplayName, 'ownerDisplayName');
|
|
54
54
|
}
|
|
55
55
|
if (expectedTree.parentID !== undefined) {
|
|
56
56
|
expectEqual(parentID, expectedTree.parentID, 'parentID');
|
|
@@ -131,7 +131,7 @@ var ReactCompositeComponentMixin = {
|
|
|
131
131
|
*/
|
|
132
132
|
construct: function (element) {
|
|
133
133
|
this._currentElement = element;
|
|
134
|
-
this._rootNodeID =
|
|
134
|
+
this._rootNodeID = 0;
|
|
135
135
|
this._compositeType = null;
|
|
136
136
|
this._instance = null;
|
|
137
137
|
this._hostParent = null;
|
|
@@ -173,8 +173,6 @@ var ReactCompositeComponentMixin = {
|
|
|
173
173
|
* @internal
|
|
174
174
|
*/
|
|
175
175
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
|
176
|
-
var _this = this;
|
|
177
|
-
|
|
178
176
|
this._context = context;
|
|
179
177
|
this._mountOrder = nextMountID++;
|
|
180
178
|
this._hostParent = hostParent;
|
|
@@ -270,15 +268,6 @@ var ReactCompositeComponentMixin = {
|
|
|
270
268
|
}
|
|
271
269
|
}
|
|
272
270
|
|
|
273
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
274
|
-
if (this._debugID) {
|
|
275
|
-
var callback = function (component) {
|
|
276
|
-
return ReactInstrumentation.debugTool.onComponentHasMounted(_this._debugID);
|
|
277
|
-
};
|
|
278
|
-
transaction.getReactMountReady().enqueue(callback, this);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
271
|
return markup;
|
|
283
272
|
},
|
|
284
273
|
|
|
@@ -388,13 +377,12 @@ var ReactCompositeComponentMixin = {
|
|
|
388
377
|
var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
|
|
389
378
|
);
|
|
390
379
|
this._renderedComponent = child;
|
|
380
|
+
|
|
381
|
+
var selfDebugID = 0;
|
|
391
382
|
if (process.env.NODE_ENV !== 'production') {
|
|
392
|
-
|
|
393
|
-
ReactInstrumentation.debugTool.onSetParent(child._debugID, this._debugID);
|
|
394
|
-
}
|
|
383
|
+
selfDebugID = this._debugID;
|
|
395
384
|
}
|
|
396
|
-
|
|
397
|
-
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context));
|
|
385
|
+
var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), selfDebugID);
|
|
398
386
|
|
|
399
387
|
if (process.env.NODE_ENV !== 'production') {
|
|
400
388
|
if (this._debugID !== 0) {
|
|
@@ -460,7 +448,7 @@ var ReactCompositeComponentMixin = {
|
|
|
460
448
|
// These fields do not really need to be reset since this object is no
|
|
461
449
|
// longer accessible.
|
|
462
450
|
this._context = null;
|
|
463
|
-
this._rootNodeID =
|
|
451
|
+
this._rootNodeID = 0;
|
|
464
452
|
this._topLevelWrapper = null;
|
|
465
453
|
|
|
466
454
|
// Delete the reference from the instance to this internal representation
|
|
@@ -716,8 +704,6 @@ var ReactCompositeComponentMixin = {
|
|
|
716
704
|
* @private
|
|
717
705
|
*/
|
|
718
706
|
_performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
|
|
719
|
-
var _this2 = this;
|
|
720
|
-
|
|
721
707
|
var inst = this._instance;
|
|
722
708
|
|
|
723
709
|
var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
|
|
@@ -759,15 +745,6 @@ var ReactCompositeComponentMixin = {
|
|
|
759
745
|
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
|
|
760
746
|
}
|
|
761
747
|
}
|
|
762
|
-
|
|
763
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
764
|
-
if (this._debugID) {
|
|
765
|
-
var callback = function () {
|
|
766
|
-
return ReactInstrumentation.debugTool.onComponentHasUpdated(_this2._debugID);
|
|
767
|
-
};
|
|
768
|
-
transaction.getReactMountReady().enqueue(callback, this);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
748
|
},
|
|
772
749
|
|
|
773
750
|
/**
|
|
@@ -791,13 +768,12 @@ var ReactCompositeComponentMixin = {
|
|
|
791
768
|
var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
|
|
792
769
|
);
|
|
793
770
|
this._renderedComponent = child;
|
|
771
|
+
|
|
772
|
+
var selfDebugID = 0;
|
|
794
773
|
if (process.env.NODE_ENV !== 'production') {
|
|
795
|
-
|
|
796
|
-
ReactInstrumentation.debugTool.onSetParent(child._debugID, this._debugID);
|
|
797
|
-
}
|
|
774
|
+
selfDebugID = this._debugID;
|
|
798
775
|
}
|
|
799
|
-
|
|
800
|
-
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context));
|
|
776
|
+
var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), selfDebugID);
|
|
801
777
|
|
|
802
778
|
if (process.env.NODE_ENV !== 'production') {
|
|
803
779
|
if (this._debugID !== 0) {
|
package/lib/ReactDOM.js
CHANGED
|
@@ -98,4 +98,13 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
102
|
+
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
103
|
+
var ReactDOMUnknownPropertyHook = require('./ReactDOMUnknownPropertyHook');
|
|
104
|
+
var ReactDOMNullInputValuePropHook = require('./ReactDOMNullInputValuePropHook');
|
|
105
|
+
|
|
106
|
+
ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
|
|
107
|
+
ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
module.exports = ReactDOM;
|
package/lib/ReactDOMComponent.js
CHANGED
|
@@ -26,7 +26,6 @@ var EventConstants = require('./EventConstants');
|
|
|
26
26
|
var EventPluginHub = require('./EventPluginHub');
|
|
27
27
|
var EventPluginRegistry = require('./EventPluginRegistry');
|
|
28
28
|
var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
|
|
29
|
-
var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
|
|
30
29
|
var ReactDOMButton = require('./ReactDOMButton');
|
|
31
30
|
var ReactDOMComponentFlags = require('./ReactDOMComponentFlags');
|
|
32
31
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
@@ -212,17 +211,11 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
this._contentDebugID = contentDebugID;
|
|
215
|
-
var text = '' + content;
|
|
216
|
-
|
|
217
|
-
ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
|
|
218
|
-
ReactInstrumentation.debugTool.onSetParent(contentDebugID, debugID);
|
|
219
|
-
ReactInstrumentation.debugTool.onSetText(contentDebugID, text);
|
|
220
|
-
|
|
221
214
|
if (hasExistingContent) {
|
|
222
215
|
ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
|
|
223
216
|
ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
|
|
224
217
|
} else {
|
|
225
|
-
ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content);
|
|
218
|
+
ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
|
|
226
219
|
ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
|
|
227
220
|
ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
|
|
228
221
|
}
|
|
@@ -383,8 +376,8 @@ function ReactDOMComponent(element) {
|
|
|
383
376
|
this._previousStyleCopy = null;
|
|
384
377
|
this._hostNode = null;
|
|
385
378
|
this._hostParent = null;
|
|
386
|
-
this._rootNodeID =
|
|
387
|
-
this._domID =
|
|
379
|
+
this._rootNodeID = 0;
|
|
380
|
+
this._domID = 0;
|
|
388
381
|
this._hostContainerInfo = null;
|
|
389
382
|
this._wrapperState = null;
|
|
390
383
|
this._topLevelWrapper = null;
|
|
@@ -405,14 +398,12 @@ ReactDOMComponent.Mixin = {
|
|
|
405
398
|
*
|
|
406
399
|
* @internal
|
|
407
400
|
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
|
408
|
-
* @param {?ReactDOMComponent} the
|
|
401
|
+
* @param {?ReactDOMComponent} the parent component instance
|
|
409
402
|
* @param {?object} info about the host container
|
|
410
403
|
* @param {object} context
|
|
411
404
|
* @return {string} The computed markup.
|
|
412
405
|
*/
|
|
413
406
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
|
414
|
-
var _this = this;
|
|
415
|
-
|
|
416
407
|
this._rootNodeID = globalIdCounter++;
|
|
417
408
|
this._domID = hostContainerInfo._idCounter++;
|
|
418
409
|
this._hostParent = hostParent;
|
|
@@ -568,15 +559,6 @@ ReactDOMComponent.Mixin = {
|
|
|
568
559
|
break;
|
|
569
560
|
}
|
|
570
561
|
|
|
571
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
572
|
-
if (this._debugID) {
|
|
573
|
-
var callback = function () {
|
|
574
|
-
return ReactInstrumentation.debugTool.onComponentHasMounted(_this._debugID);
|
|
575
|
-
};
|
|
576
|
-
transaction.getReactMountReady().enqueue(callback, this);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
562
|
return mountImage;
|
|
581
563
|
},
|
|
582
564
|
|
|
@@ -745,8 +727,6 @@ ReactDOMComponent.Mixin = {
|
|
|
745
727
|
* @overridable
|
|
746
728
|
*/
|
|
747
729
|
updateComponent: function (transaction, prevElement, nextElement, context) {
|
|
748
|
-
var _this2 = this;
|
|
749
|
-
|
|
750
730
|
var lastProps = prevElement.props;
|
|
751
731
|
var nextProps = this._currentElement.props;
|
|
752
732
|
|
|
@@ -756,7 +736,6 @@ ReactDOMComponent.Mixin = {
|
|
|
756
736
|
nextProps = ReactDOMButton.getHostProps(this, nextProps);
|
|
757
737
|
break;
|
|
758
738
|
case 'input':
|
|
759
|
-
ReactDOMInput.updateWrapper(this);
|
|
760
739
|
lastProps = ReactDOMInput.getHostProps(this, lastProps);
|
|
761
740
|
nextProps = ReactDOMInput.getHostProps(this, nextProps);
|
|
762
741
|
break;
|
|
@@ -769,7 +748,6 @@ ReactDOMComponent.Mixin = {
|
|
|
769
748
|
nextProps = ReactDOMSelect.getHostProps(this, nextProps);
|
|
770
749
|
break;
|
|
771
750
|
case 'textarea':
|
|
772
|
-
ReactDOMTextarea.updateWrapper(this);
|
|
773
751
|
lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
|
|
774
752
|
nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
|
|
775
753
|
break;
|
|
@@ -779,19 +757,21 @@ ReactDOMComponent.Mixin = {
|
|
|
779
757
|
this._updateDOMProperties(lastProps, nextProps, transaction);
|
|
780
758
|
this._updateDOMChildren(lastProps, nextProps, transaction, context);
|
|
781
759
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
760
|
+
switch (this._tag) {
|
|
761
|
+
case 'input':
|
|
762
|
+
// Update the wrapper around inputs *after* updating props. This has to
|
|
763
|
+
// happen after `_updateDOMProperties`. Otherwise HTML5 input validations
|
|
764
|
+
// raise warnings and prevent the new value from being assigned.
|
|
765
|
+
ReactDOMInput.updateWrapper(this);
|
|
766
|
+
break;
|
|
767
|
+
case 'textarea':
|
|
768
|
+
ReactDOMTextarea.updateWrapper(this);
|
|
769
|
+
break;
|
|
770
|
+
case 'select':
|
|
771
|
+
// <select> value update needs to occur after <option> children
|
|
772
|
+
// reconciliation
|
|
773
|
+
transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
|
|
774
|
+
break;
|
|
795
775
|
}
|
|
796
776
|
},
|
|
797
777
|
|
|
@@ -1004,9 +984,8 @@ ReactDOMComponent.Mixin = {
|
|
|
1004
984
|
this.unmountChildren(safely);
|
|
1005
985
|
ReactDOMComponentTree.uncacheNode(this);
|
|
1006
986
|
EventPluginHub.deleteAllListeners(this);
|
|
1007
|
-
|
|
1008
|
-
this.
|
|
1009
|
-
this._domID = null;
|
|
987
|
+
this._rootNodeID = 0;
|
|
988
|
+
this._domID = 0;
|
|
1010
989
|
this._wrapperState = null;
|
|
1011
990
|
|
|
1012
991
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -82,7 +82,7 @@ function precacheChildNodes(inst, node) {
|
|
|
82
82
|
}
|
|
83
83
|
var childInst = children[name];
|
|
84
84
|
var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
|
|
85
|
-
if (childID
|
|
85
|
+
if (childID === 0) {
|
|
86
86
|
// We're currently unmounting this child in ReactMultiChild; skip it.
|
|
87
87
|
continue;
|
|
88
88
|
}
|
|
@@ -23,7 +23,7 @@ var ReactDOMEmptyComponent = function (instantiate) {
|
|
|
23
23
|
this._hostNode = null;
|
|
24
24
|
this._hostParent = null;
|
|
25
25
|
this._hostContainerInfo = null;
|
|
26
|
-
this._domID =
|
|
26
|
+
this._domID = 0;
|
|
27
27
|
};
|
|
28
28
|
_assign(ReactDOMEmptyComponent.prototype, {
|
|
29
29
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
package/lib/ReactDOMInput.js
CHANGED
|
@@ -175,8 +175,26 @@ var ReactDOMInput = {
|
|
|
175
175
|
// are not resetable nodes so this operation doesn't matter and actually
|
|
176
176
|
// removes browser-default values (eg "Submit Query") when no value is
|
|
177
177
|
// provided.
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
|
|
179
|
+
switch (props.type) {
|
|
180
|
+
case 'submit':
|
|
181
|
+
case 'reset':
|
|
182
|
+
break;
|
|
183
|
+
case 'color':
|
|
184
|
+
case 'date':
|
|
185
|
+
case 'datetime':
|
|
186
|
+
case 'datetime-local':
|
|
187
|
+
case 'month':
|
|
188
|
+
case 'time':
|
|
189
|
+
case 'week':
|
|
190
|
+
// This fixes the no-show issue on iOS Safari and Android Chrome:
|
|
191
|
+
// https://github.com/facebook/react/issues/7233
|
|
192
|
+
node.value = '';
|
|
193
|
+
node.value = node.defaultValue;
|
|
194
|
+
break;
|
|
195
|
+
default:
|
|
196
|
+
node.value = node.value;
|
|
197
|
+
break;
|
|
180
198
|
}
|
|
181
199
|
|
|
182
200
|
// Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
9
|
+
* @providesModule ReactDOMNullInputValuePropHook
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
15
15
|
|
|
16
16
|
var warning = require('fbjs/lib/warning');
|
|
17
17
|
|
|
@@ -25,13 +25,13 @@ function handleElement(debugID, element) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
if (element.props != null && element.props.value === null && !didWarnValueNull) {
|
|
28
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type,
|
|
28
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
|
29
29
|
|
|
30
30
|
didWarnValueNull = true;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var ReactDOMNullInputValuePropHook = {
|
|
35
35
|
onBeforeMountComponent: function (debugID, element) {
|
|
36
36
|
handleElement(debugID, element);
|
|
37
37
|
},
|
|
@@ -40,4 +40,4 @@ var ReactDOMUnknownPropertyDevtool = {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
module.exports =
|
|
43
|
+
module.exports = ReactDOMNullInputValuePropHook;
|
package/lib/ReactDOMSelect.js
CHANGED
|
@@ -66,10 +66,11 @@ function checkSelectPropTypes(inst, props) {
|
|
|
66
66
|
if (props[propName] == null) {
|
|
67
67
|
continue;
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
var isArray = Array.isArray(props[propName]);
|
|
70
|
+
if (props.multiple && !isArray) {
|
|
71
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
|
72
|
+
} else if (!props.multiple && isArray) {
|
|
73
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}
|
|
@@ -17,7 +17,6 @@ var _prodInvariant = require('./reactProdInvariant'),
|
|
|
17
17
|
var DOMChildrenOperations = require('./DOMChildrenOperations');
|
|
18
18
|
var DOMLazyTree = require('./DOMLazyTree');
|
|
19
19
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
20
|
-
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
21
20
|
|
|
22
21
|
var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
|
|
23
22
|
var invariant = require('fbjs/lib/invariant');
|
|
@@ -47,7 +46,7 @@ var ReactDOMTextComponent = function (text) {
|
|
|
47
46
|
this._hostParent = null;
|
|
48
47
|
|
|
49
48
|
// Properties
|
|
50
|
-
this._domID =
|
|
49
|
+
this._domID = 0;
|
|
51
50
|
this._mountIndex = 0;
|
|
52
51
|
this._closingComment = null;
|
|
53
52
|
this._commentNodes = null;
|
|
@@ -65,8 +64,6 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
65
64
|
*/
|
|
66
65
|
mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
|
|
67
66
|
if (process.env.NODE_ENV !== 'production') {
|
|
68
|
-
ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
|
|
69
|
-
|
|
70
67
|
var parentInfo;
|
|
71
68
|
if (hostParent != null) {
|
|
72
69
|
parentInfo = hostParent._ancestorInfo;
|
|
@@ -130,10 +127,6 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
130
127
|
this._stringText = nextStringText;
|
|
131
128
|
var commentNodes = this.getHostNode();
|
|
132
129
|
DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
|
|
133
|
-
|
|
134
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
135
|
-
ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
|
|
136
|
-
}
|
|
137
130
|
}
|
|
138
131
|
}
|
|
139
132
|
},
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
9
|
+
* @providesModule ReactDOMUnknownPropertyHook
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var DOMProperty = require('./DOMProperty');
|
|
15
15
|
var EventPluginRegistry = require('./EventPluginRegistry');
|
|
16
|
-
var
|
|
16
|
+
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
17
17
|
|
|
18
18
|
var warning = require('fbjs/lib/warning');
|
|
19
19
|
|
|
@@ -55,10 +55,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
55
55
|
var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
|
|
56
56
|
|
|
57
57
|
if (standardName != null) {
|
|
58
|
-
process.env.NODE_ENV !== 'production' ? warning(
|
|
58
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
|
59
59
|
return true;
|
|
60
60
|
} else if (registrationName != null) {
|
|
61
|
-
process.env.NODE_ENV !== 'production' ? warning(
|
|
61
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
|
62
62
|
return true;
|
|
63
63
|
} else {
|
|
64
64
|
// We were unable to guess which prop the user intended.
|
|
@@ -84,9 +84,9 @@ var warnUnknownProperties = function (debugID, element) {
|
|
|
84
84
|
}).join(', ');
|
|
85
85
|
|
|
86
86
|
if (unknownProps.length === 1) {
|
|
87
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type,
|
|
87
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
|
88
88
|
} else if (unknownProps.length > 1) {
|
|
89
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type,
|
|
89
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
|
|
@@ -100,7 +100,7 @@ function handleElement(debugID, element) {
|
|
|
100
100
|
warnUnknownProperties(debugID, element);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
var
|
|
103
|
+
var ReactDOMUnknownPropertyHook = {
|
|
104
104
|
onBeforeMountComponent: function (debugID, element) {
|
|
105
105
|
handleElement(debugID, element);
|
|
106
106
|
},
|
|
@@ -109,4 +109,4 @@ var ReactDOMUnknownPropertyDevtool = {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
module.exports =
|
|
112
|
+
module.exports = ReactDOMUnknownPropertyHook;
|