fix NativeAnimated event listener bug
Summary: This bugfix cleans up reference to value listener upon unsubscribing to native events ultimately preventing RCTEventEmitter from throwing a [listener count error](https://github.com/facebook/react-native/blob/v0.33.0-rc.0/React/Modules/RCTEventEmitter.m#L90): `Attempted to remove more RCTNativeAnimatedModule listeners than added` /cc janicduplessis sahrens 🍺 Closes https://github.com/facebook/react-native/pull/9729 Differential Revision: D3818241 Pulled By: sahrens fbshipit-source-id: e235e3f97534ef2a50df29877ce36d3b6095237e
This commit is contained in:
parent
dcdf16a0fb
commit
64009b61cc
|
@ -788,6 +788,7 @@ class AnimatedValue extends AnimatedWithChildren {
|
|||
}
|
||||
|
||||
this.__nativeAnimatedValueListener.remove();
|
||||
this.__nativeAnimatedValueListener = null;
|
||||
NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue