From 8d4dd248b2fa672903fd9bf452c0dfbb8ba49e73 Mon Sep 17 00:00:00 2001 From: Tomek Zawadzki Date: Wed, 21 Jun 2023 15:18:16 +0200 Subject: [PATCH] Fix update props flush for multiple view descriptors --- src/reanimated2/UpdateProps.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reanimated2/UpdateProps.ts b/src/reanimated2/UpdateProps.ts index 00e2f07d658..84b3fdcc775 100644 --- a/src/reanimated2/UpdateProps.ts +++ b/src/reanimated2/UpdateProps.ts @@ -100,10 +100,10 @@ const createUpdatePropsManager = global._IS_FABRIC shadowNodeWrapper: viewDescriptor.shadowNodeWrapper, updates, }); + if (operations.length === 1) { + queueMicrotask(this.flush); + } }); - if (operations.length === 1) { - queueMicrotask(this.flush); - } }, flush() { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -131,10 +131,10 @@ const createUpdatePropsManager = global._IS_FABRIC name: viewDescriptor.name || 'RCTView', updates, }); + if (operations.length === 1) { + queueMicrotask(this.flush); + } }); - if (operations.length === 1) { - queueMicrotask(this.flush); - } }, flush() { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion