@samitouri / QOS-React-2 / commits / eb00290673

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.

Ben Alpert committed Jan 4, 2016 at 19:36 UTC eb002906735e4fc914c588a73a119d066b569b79
2 files changed +1 -19
src/renderers/dom/shared/ReactDOMComponent.js
+1 -10
@@ -1080,16 +1080,7 @@ ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
1080 assign(
1081 ReactDOMComponent.prototype,
1082 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
1084 );
1085
1086 module.exports = ReactDOMComponent;
src/renderers/shared/reconciler/ReactMultiChild.js
-9
@@ -354,7 +354,6 @@ var ReactMultiChild = {
354 }
355 }
356 if (updates) {
357 - this.prepareToManageChildren();
357 processQueue(this, updates);
358 }
359 this._renderedChildren = nextChildren;
@@ -373,14 +372,6 @@ var ReactMultiChild = {
372 this._renderedChildren = null;
373 },
374
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 -
375 /**
376 * Moves a child component to the supplied index.
377 *