Fix order of calls for Native Animated Module
Summary: Changelog: [internal] Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash. To resolve it, we need to enqueue `getValue` onto operationQueue. Reviewed By: JoshuaGross Differential Revision: D30035911 fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc
This commit is contained in:
Родитель
0b4f4eec8e
Коммит
8a8a5323cf
|
@ -47,9 +47,9 @@ const API = {
|
|||
saveValueCallback: (value: number) => void,
|
||||
): void {
|
||||
invariant(NativeAnimatedModule, 'Native animated module is not available');
|
||||
if (NativeAnimatedModule.getValue) {
|
||||
API.queueOperation(() => {
|
||||
NativeAnimatedModule.getValue(tag, saveValueCallback);
|
||||
}
|
||||
});
|
||||
},
|
||||
setWaitingForIdentifier: function(id: string): void {
|
||||
waitingForQueuedOperations.add(id);
|
||||
|
|
Загрузка…
Ссылка в новой задаче