mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove now-unused _rootNodeID from composites
This commit is contained in:
1 parent
e48c8be556
commit
3cebadaa6b
9 files changed
+5
-38
No files matched your search
@@ -83,14 +83,12 @@ function internalGetID(node) {
|
||||
* Mounts this component and inserts it into the DOM.
|
||||
*
|
||||
* @param {ReactComponent} componentInstance The instance to mount.
|
||||
* @param {string} rootID DOM ID of the root node.
|
||||
* @param {DOMElement} container DOM element to mount into.
|
||||
* @param {ReactReconcileTransaction} transaction
|
||||
* @param {boolean} shouldReuseMarkup If true, do not insert markup
|
||||
*/
|
||||
function mountComponentIntoNode(
|
||||
wrapperInstance,
|
||||
rootID,
|
||||
container,
|
||||
transaction,
|
||||
shouldReuseMarkup,
|
||||
@@ -98,7 +96,6 @@ function mountComponentIntoNode(
|
||||
) {
|
||||
var markup = ReactReconciler.mountComponent(
|
||||
wrapperInstance,
|
||||
rootID,
|
||||
transaction,
|
||||
null,
|
||||
ReactDOMContainerInfo(wrapperInstance, container),
|
||||
@@ -118,13 +115,11 @@ function mountComponentIntoNode(
|
||||
* Batched mount.
|
||||
*
|
||||
* @param {ReactComponent} componentInstance The instance to mount.
|
||||
* @param {string} rootID DOM ID of the root node.
|
||||
* @param {DOMElement} container DOM element to mount into.
|
||||
* @param {boolean} shouldReuseMarkup If true, do not insert markup
|
||||
*/
|
||||
function batchedMountComponentIntoNode(
|
||||
componentInstance,
|
||||
rootID,
|
||||
container,
|
||||
shouldReuseMarkup,
|
||||
context
|
||||
@@ -137,7 +132,6 @@ function batchedMountComponentIntoNode(
|
||||
mountComponentIntoNode,
|
||||
null,
|
||||
componentInstance,
|
||||
rootID,
|
||||
container,
|
||||
transaction,
|
||||
shouldReuseMarkup,
|
||||
@@ -311,7 +305,6 @@ var ReactMount = {
|
||||
ReactUpdates.batchedUpdates(
|
||||
batchedMountComponentIntoNode,
|
||||
componentInstance,
|
||||
'',
|
||||
container,
|
||||
shouldReuseMarkup,
|
||||
context
|
||||
|
||||
@@ -43,7 +43,6 @@ function renderToStringImpl(element, makeStaticMarkup) {
|
||||
return transaction.perform(function() {
|
||||
var componentInstance = instantiateReactComponent(element, null);
|
||||
var markup = componentInstance.mountComponent(
|
||||
'',
|
||||
transaction,
|
||||
null,
|
||||
ReactDOMContainerInfo(),
|
||||
|
||||
@@ -543,7 +543,6 @@ ReactDOMComponent.Mixin = {
|
||||
* is not idempotent.
|
||||
*
|
||||
* @internal
|
||||
* @param {string} rootID The root DOM ID for this node.
|
||||
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
||||
* @param {?ReactDOMComponent} the containing DOM component instance
|
||||
* @param {?object} info about the native container
|
||||
@@ -551,7 +550,6 @@ ReactDOMComponent.Mixin = {
|
||||
* @return {string} The computed markup.
|
||||
*/
|
||||
mountComponent: function(
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
|
||||
@@ -66,13 +66,11 @@ assign(ReactDOMTextComponent.prototype, {
|
||||
* Creates the markup for this text node. This node is not intended to have
|
||||
* any features besides containing text content.
|
||||
*
|
||||
* @param {string} rootID DOM ID of the root node.
|
||||
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
||||
* @return {string} Markup for this text node.
|
||||
* @internal
|
||||
*/
|
||||
mountComponent: function(
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
|
||||
@@ -120,7 +120,6 @@ var ReactCompositeComponentMixin = {
|
||||
/**
|
||||
* Initializes the component, renders markup, and registers event listeners.
|
||||
*
|
||||
* @param {string} rootID DOM ID of the root node.
|
||||
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
||||
* @param {?object} nativeParent
|
||||
* @param {?object} nativeContainerInfo
|
||||
@@ -130,7 +129,6 @@ var ReactCompositeComponentMixin = {
|
||||
* @internal
|
||||
*/
|
||||
mountComponent: function(
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
@@ -138,7 +136,6 @@ var ReactCompositeComponentMixin = {
|
||||
) {
|
||||
this._context = context;
|
||||
this._mountOrder = nextMountID++;
|
||||
this._rootNodeID = rootID;
|
||||
this._nativeParent = nativeParent;
|
||||
this._nativeContainerInfo = nativeContainerInfo;
|
||||
|
||||
@@ -302,7 +299,6 @@ var ReactCompositeComponentMixin = {
|
||||
|
||||
var markup = ReactReconciler.mountComponent(
|
||||
this._renderedComponent,
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
@@ -764,7 +760,6 @@ var ReactCompositeComponentMixin = {
|
||||
);
|
||||
var nextMarkup = ReactReconciler.mountComponent(
|
||||
this._renderedComponent,
|
||||
this._rootNodeID,
|
||||
transaction,
|
||||
this._nativeParent,
|
||||
this._nativeContainerInfo,
|
||||
|
||||
@@ -26,23 +26,19 @@ var ReactEmptyComponentInjection = {
|
||||
|
||||
var ReactEmptyComponent = function(instantiate) {
|
||||
this._currentElement = null;
|
||||
this._rootNodeID = null;
|
||||
this._renderedComponent = instantiate(placeholderElement);
|
||||
};
|
||||
assign(ReactEmptyComponent.prototype, {
|
||||
construct: function(element) {
|
||||
},
|
||||
mountComponent: function(
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
context
|
||||
) {
|
||||
this._rootNodeID = rootID;
|
||||
return ReactReconciler.mountComponent(
|
||||
this._renderedComponent,
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
@@ -54,9 +50,8 @@ assign(ReactEmptyComponent.prototype, {
|
||||
getNativeNode: function() {
|
||||
return ReactReconciler.getNativeNode(this._renderedComponent);
|
||||
},
|
||||
unmountComponent: function(rootID, transaction, context) {
|
||||
unmountComponent: function() {
|
||||
ReactReconciler.unmountComponent(this._renderedComponent);
|
||||
this._rootNodeID = null;
|
||||
this._renderedComponent = null;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -251,7 +251,6 @@ var ReactMultiChild = {
|
||||
var child = children[name];
|
||||
var mountImage = ReactReconciler.mountComponent(
|
||||
child,
|
||||
name,
|
||||
transaction,
|
||||
this,
|
||||
this._nativeContainerInfo,
|
||||
@@ -394,8 +393,8 @@ var ReactMultiChild = {
|
||||
this._unmountChild(prevChild);
|
||||
}
|
||||
// The child must be instantiated before it's mounted.
|
||||
this._mountChildByNameAtIndex(
|
||||
nextChild, name, nextIndex, transaction, context
|
||||
this._mountChildAtIndex(
|
||||
nextChild, nextIndex, transaction, context
|
||||
);
|
||||
}
|
||||
nextIndex++;
|
||||
@@ -502,15 +501,13 @@ var ReactMultiChild = {
|
||||
* @param {ReactReconcileTransaction} transaction
|
||||
* @private
|
||||
*/
|
||||
_mountChildByNameAtIndex: function(
|
||||
_mountChildAtIndex: function(
|
||||
child,
|
||||
name,
|
||||
index,
|
||||
transaction,
|
||||
context) {
|
||||
var mountImage = ReactReconciler.mountComponent(
|
||||
child,
|
||||
name,
|
||||
transaction,
|
||||
this,
|
||||
this._nativeContainerInfo,
|
||||
|
||||
@@ -27,7 +27,6 @@ var ReactReconciler = {
|
||||
* Initializes the component, renders markup, and registers event listeners.
|
||||
*
|
||||
* @param {ReactComponent} internalInstance
|
||||
* @param {string} rootID DOM ID of the root node.
|
||||
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
||||
* @param {?object} the containing native component instance
|
||||
* @param {?object} info about the native container
|
||||
@@ -37,14 +36,12 @@ var ReactReconciler = {
|
||||
*/
|
||||
mountComponent: function(
|
||||
internalInstance,
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
context
|
||||
) {
|
||||
var markup = internalInstance.mountComponent(
|
||||
rootID,
|
||||
transaction,
|
||||
nativeParent,
|
||||
nativeContainerInfo,
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var ClientReactRootIndex = require('ClientReactRootIndex');
|
||||
var EventConstants = require('EventConstants');
|
||||
var EventPluginHub = require('EventPluginHub');
|
||||
var EventPluginRegistry = require('EventPluginRegistry');
|
||||
@@ -22,7 +21,6 @@ var ReactDOMComponentTree = require('ReactDOMComponentTree');
|
||||
var ReactElement = require('ReactElement');
|
||||
var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');
|
||||
var ReactCompositeComponent = require('ReactCompositeComponent');
|
||||
var ReactInstanceHandles = require('ReactInstanceHandles');
|
||||
var ReactInstanceMap = require('ReactInstanceMap');
|
||||
var ReactUpdates = require('ReactUpdates');
|
||||
var SyntheticEvent = require('SyntheticEvent');
|
||||
@@ -447,13 +445,10 @@ ReactShallowRenderer.prototype._render = function(element, transaction, context)
|
||||
if (this._instance) {
|
||||
this._instance.receiveComponent(element, transaction, context);
|
||||
} else {
|
||||
var rootID = ReactInstanceHandles.createReactRootID(
|
||||
ClientReactRootIndex.createReactRootIndex()
|
||||
);
|
||||
var instance = new ShallowComponentWrapper(element.type);
|
||||
instance.construct(element);
|
||||
|
||||
instance.mountComponent(rootID, transaction, null, null, context);
|
||||
instance.mountComponent(transaction, null, null, context);
|
||||
|
||||
this._instance = instance;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user