Listeners are not attached by ID in the API

...even though they technically still are attached by.
This commit is contained in:
Sebastian Markbage
2016-04-20 03:35:31 +01:00
parent 3287d93235
commit 4fcdf02068
@@ -59,7 +59,7 @@ ReactNativeBaseComponent.Mixin = {
unmountComponent: function() {
ReactNativeComponentTree.uncacheNode(this);
deleteAllListeners(this._rootNodeID);
deleteAllListeners(this);
this.unmountChildren();
this._rootNodeID = null;
},
@@ -141,7 +141,7 @@ ReactNativeBaseComponent.Mixin = {
// registers listeners the *first* time a component is created.
if (registrationNames[key] && initialProps[key]) {
var listener = initialProps[key];
putListener(this._rootNodeID, key, listener);
putListener(this, key, listener);
}
}
},
@@ -155,9 +155,9 @@ ReactNativeBaseComponent.Mixin = {
for (var key in nextProps) {
if (registrationNames[key] && (nextProps[key] !== prevProps[key])) {
if (nextProps[key]) {
putListener(this._rootNodeID, key, nextProps[key]);
putListener(this, key, nextProps[key]);
} else {
deleteListener(this._rootNodeID, key);
deleteListener(this, key);
}
}
}