Skip to content

Commit

Permalink
Remove now-unused prepareToManageChildren
Browse files Browse the repository at this point in the history
This was a temporary hook needed for the DOM implementation. We no longer need it because we now necessarily load every node into cache (via calling getNativeNode on it) before manipulating any of its siblings.
  • Loading branch information
sophiebits committed Jan 5, 2016
1 parent 2792657 commit eb00290
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
11 changes: 1 addition & 10 deletions src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,16 +1080,7 @@ ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
assign(
ReactDOMComponent.prototype,
ReactDOMComponent.Mixin,
ReactMultiChild.Mixin,
{
prepareToManageChildren: function() {
// Before we add, remove, or reorder the children of a node, make sure
// we have references to all of its children so we don't lose them, even
// if nefarious browser plugins add extra nodes to our tree. This could be
// called once per child so it should be fast.
ReactDOMComponentTree.precacheChildNodes(this, getNode(this));
},
}
ReactMultiChild.Mixin
);

module.exports = ReactDOMComponent;
9 changes: 0 additions & 9 deletions src/renderers/shared/reconciler/ReactMultiChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ var ReactMultiChild = {
}
}
if (updates) {
this.prepareToManageChildren();
processQueue(this, updates);
}
this._renderedChildren = nextChildren;
Expand All @@ -373,14 +372,6 @@ var ReactMultiChild = {
this._renderedChildren = null;
},

/**
* Hook used by the DOM implementation to precache the nodes before we apply
* any reorders here.
*/
prepareToManageChildren: function() {
// TODO: This sucks. Figure out a better design here.
},

/**
* Moves a child component to the supplied index.
*
Expand Down

0 comments on commit eb00290

Please sign in to comment.