Skip to content

Commit f021bef

Browse files
committed
Update to not use _mountImage
See facebook/react#852.
1 parent 3329e04 commit f021bef

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/ReactART.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var ContainerMixin = merge(ReactMultiChild.Mixin, {
8181
* @protected
8282
*/
8383
moveChild: function(child, toIndex) {
84-
var childNode = child._mountImage;
84+
var childNode = this._childNodes[child._rootNodeID];
8585
var mostRecentlyPlacedChild = this._mostRecentlyPlacedChild;
8686
if (mostRecentlyPlacedChild == null) {
8787
// I'm supposed to be first.
@@ -109,10 +109,15 @@ var ContainerMixin = merge(ReactMultiChild.Mixin, {
109109
* Creates a child component.
110110
*
111111
* @param {ReactComponent} child Component to create.
112+
* @param {object} childNode ART node to insert.
112113
* @protected
113114
*/
114-
createChild: function(child) {
115-
var childNode = child._mountImage;
115+
createChild: function(child, childNode) {
116+
if (this._childNodes == null) {
117+
this._childNodes = {};
118+
}
119+
this._childNodes[child._rootNodeID] = childNode;
120+
116121
var mostRecentlyPlacedChild = this._mostRecentlyPlacedChild;
117122
if (mostRecentlyPlacedChild == null) {
118123
// I'm supposed to be first.
@@ -139,7 +144,9 @@ var ContainerMixin = merge(ReactMultiChild.Mixin, {
139144
* @protected
140145
*/
141146
removeChild: function(child) {
142-
child._mountImage.eject();
147+
var childNode = this._childNodes[child._rootNodeID];
148+
childNode.eject();
149+
delete this._childNodes[child._rootNodeID];
143150
},
144151

145152
/**

0 commit comments

Comments
 (0)