mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add check for native animated node existing before starting animation
Summary: We need to check that the animated node exists prior to executing the animation. The native animated node lifecycle is not synced with Fabric and nodes are frequently destroyed and re-created on rerenders. Therefore, there is a possibility that the the animated node does not exist when the native event is dispatched, in particular with native call batching. Changelog: [Internal] - Make NativeAnimatedNodesManager.getNodeById public Reviewed By: JoshuaGross Differential Revision: D37323138 fbshipit-source-id: ed0567871b4189c454b6b3145b853ecdfe844840
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a0d597dbca
commit
b5f1b3dffc
+2
-2
@@ -100,8 +100,8 @@ public class NativeAnimatedNodesManager implements EventDispatcherListener {
|
||||
}
|
||||
}
|
||||
|
||||
/*package*/ @Nullable
|
||||
AnimatedNode getNodeById(int id) {
|
||||
@Nullable
|
||||
public AnimatedNode getNodeById(int id) {
|
||||
return mAnimatedNodes.get(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user