mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove rootNodeID
We only use this to determine if something is mounted or not but I don't think we really need to.
This commit is contained in:
@@ -351,7 +351,6 @@ function trapBubbledEventsLocal() {
|
||||
var inst = this;
|
||||
// If a component renders to null or if another component fatals and causes
|
||||
// the state of the tree to be corrupted, `node` here can be null.
|
||||
invariant(inst._rootNodeID, 'Must be mounted to trap events');
|
||||
var node = getNode(inst);
|
||||
invariant(
|
||||
node,
|
||||
@@ -736,8 +735,6 @@ function updateDOMChildren(workInProgress, lastProps, nextProps, transaction, co
|
||||
}
|
||||
}
|
||||
|
||||
var globalIdCounter = 1;
|
||||
|
||||
var ReactDOMFiberComponent = {
|
||||
|
||||
|
||||
@@ -763,7 +760,6 @@ var ReactDOMFiberComponent = {
|
||||
// workInProgress._tag = tag.toLowerCase();
|
||||
// setAndValidateContentChildDev.call(workInProgress, null);
|
||||
|
||||
workInProgress._rootNodeID = globalIdCounter++;
|
||||
workInProgress._domID = hostContainerInfo._idCounter++;
|
||||
workInProgress._hostParent = hostParent;
|
||||
workInProgress._hostContainerInfo = hostContainerInfo;
|
||||
@@ -1089,7 +1085,6 @@ var ReactDOMFiberComponent = {
|
||||
workInProgress.unmountChildren(safely, skipLifecycle);
|
||||
ReactDOMComponentTree.uncacheNode(workInProgress);
|
||||
EventPluginHub.deleteAllListeners(workInProgress);
|
||||
workInProgress._rootNodeID = 0;
|
||||
workInProgress._domID = 0;
|
||||
workInProgress._wrapperState = null;
|
||||
|
||||
|
||||
@@ -256,10 +256,7 @@ var ReactDOMInput = {
|
||||
},
|
||||
|
||||
restoreControlledState: function(inst) {
|
||||
if (inst._rootNodeID) {
|
||||
// DOM component is still mounted; update
|
||||
ReactDOMInput.updateWrapper(inst);
|
||||
}
|
||||
ReactDOMInput.updateWrapper(inst);
|
||||
var props = inst._currentElement.props;
|
||||
updateNamedCousins(inst, props);
|
||||
},
|
||||
@@ -304,9 +301,7 @@ function updateNamedCousins(thisInstance, props) {
|
||||
// If this is a controlled radio button group, forcing the input that
|
||||
// was previously checked to update will cause it to be come re-checked
|
||||
// as appropriate.
|
||||
if (otherInstance._rootNodeID) {
|
||||
ReactDOMInput.updateWrapper(otherInstance);
|
||||
}
|
||||
ReactDOMInput.updateWrapper(otherInstance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,13 +187,11 @@ var ReactDOMSelect = {
|
||||
},
|
||||
|
||||
restoreControlledState: function(inst) {
|
||||
if (inst._rootNodeID) {
|
||||
var props = inst._currentElement.props;
|
||||
var value = props.value;
|
||||
var props = inst._currentElement.props;
|
||||
var value = props.value;
|
||||
|
||||
if (value != null) {
|
||||
updateOptions(inst, Boolean(props.multiple), value);
|
||||
}
|
||||
if (value != null) {
|
||||
updateOptions(inst, Boolean(props.multiple), value);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -162,10 +162,8 @@ var ReactDOMTextarea = {
|
||||
},
|
||||
|
||||
restoreControlledState: function(inst) {
|
||||
if (inst._rootNodeID) {
|
||||
// DOM component is still mounted; update
|
||||
ReactDOMTextarea.updateWrapper(inst);
|
||||
}
|
||||
// DOM component is still mounted; update
|
||||
ReactDOMTextarea.updateWrapper(inst);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user