[fix] Avoid retaining DOM nodes in Touchable

Explicitly clear the DOM nodes to prevent memory leaks.

Fix #2039
Close #2047
This commit is contained in:
Bhanu Teja Allaparthi
2021-06-07 13:59:39 -07:00
committed by Nicolas Gallagher
parent 5b7b974224
commit 968b3e90a1
@@ -393,6 +393,10 @@ const TouchableMixin = {
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);
// Clear DOM nodes
this.pressInLocation = null;
this.state.touchable.responderID = null;
this._touchableNode = null;
},
/**