Add additional field for ART reconciler

ART, just like MultiChild adds an expando property to manage it's diffing
state. This is ugly and bad. We should be moving this state outside the
component for use by the diffing algorithm. This state is not needed by
components nested in composites, and varies by diffing algorithm.

It sucks that I have to add it to every component just to support ART,
but that's the quickest solution, other than disabling preventExtensions.

At least now we know that it sucks.
This commit is contained in:
Sebastian Markbage committed 2014-11-24 17:02:11 -08:00
1 parent f8aee772ce
commit 61349eb5a6
1 file changed
+4
+4
View File
@@ -89,7 +89,11 @@ var ReactComponent = {
// We keep the old element and a reference to the pending element
// to track updates.
this._currentElement = element;
// These two fields are used by the DOM and ART diffing algorithms
// respectively. Instead of using expandos on components, we should be
// storing the state needed by the diffing algorithms elsewhere.
this._mountIndex = 0;
this._mountImage = null;
},
/**