Skip to content

Commit eb00290

Browse files
committed
Remove now-unused prepareToManageChildren
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.
1 parent 2792657 commit eb00290

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/renderers/dom/shared/ReactDOMComponent.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,16 +1080,7 @@ ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
10801080
assign(
10811081
ReactDOMComponent.prototype,
10821082
ReactDOMComponent.Mixin,
1083-
ReactMultiChild.Mixin,
1084-
{
1085-
prepareToManageChildren: function() {
1086-
// Before we add, remove, or reorder the children of a node, make sure
1087-
// we have references to all of its children so we don't lose them, even
1088-
// if nefarious browser plugins add extra nodes to our tree. This could be
1089-
// called once per child so it should be fast.
1090-
ReactDOMComponentTree.precacheChildNodes(this, getNode(this));
1091-
},
1092-
}
1083+
ReactMultiChild.Mixin
10931084
);
10941085

10951086
module.exports = ReactDOMComponent;

src/renderers/shared/reconciler/ReactMultiChild.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ var ReactMultiChild = {
354354
}
355355
}
356356
if (updates) {
357-
this.prepareToManageChildren();
358357
processQueue(this, updates);
359358
}
360359
this._renderedChildren = nextChildren;
@@ -373,14 +372,6 @@ var ReactMultiChild = {
373372
this._renderedChildren = null;
374373
},
375374

376-
/**
377-
* Hook used by the DOM implementation to precache the nodes before we apply
378-
* any reorders here.
379-
*/
380-
prepareToManageChildren: function() {
381-
// TODO: This sucks. Figure out a better design here.
382-
},
383-
384375
/**
385376
* Moves a child component to the supplied index.
386377
*

0 commit comments

Comments
 (0)