@samitouri / QOS-React-2 / commits / 4d3a9c87d1

Don't store mount image on component instance

Ben Alpert committed Jan 8, 2014 at 22:53 UTC 4d3a9c87d1e7e238972fa5ec5d8797950f0ff493
1 file changed +4 -6
src/core/ReactMultiChild.js
+4 -6
@@ -199,7 +199,6 @@ var ReactMultiChild = {
199 transaction,
200 this._mountDepth + 1
201 );
202 - child._mountImage = mountImage;
202 child._mountIndex = index;
203 mountImages.push(mountImage);
204 index++;
@@ -346,10 +345,11 @@ var ReactMultiChild = {
345 * Creates a child component.
346 *
347 * @param {ReactComponent} child Component to create.
348 + * @param {string} mountImage Markup to insert.
349 * @protected
350 */
351 - createChild: function(child) {
352 - enqueueMarkup(this._rootNodeID, child._mountImage, child._mountIndex);
351 + createChild: function(child, mountImage) {
352 + enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex);
353 },
354
355 /**
@@ -391,9 +391,8 @@ var ReactMultiChild = {
391 transaction,
392 this._mountDepth + 1
393 );
394 - child._mountImage = mountImage;
394 child._mountIndex = index;
396 - this.createChild(child);
395 + this.createChild(child, mountImage);
396 this._renderedChildren = this._renderedChildren || {};
397 this._renderedChildren[name] = child;
398 },
@@ -411,7 +410,6 @@ var ReactMultiChild = {
410 // TODO: When is this not true?
411 if (ReactComponent.isValidComponent(child)) {
412 this.removeChild(child);
414 - child._mountImage = null;
413 child._mountIndex = null;
414 child.unmountComponent();
415 delete this._renderedChildren[name];