From 8db2995934b7ed313d16de8fbc005eece504a91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Wed, 3 Jul 2024 05:01:02 -0700 Subject: [PATCH] Add missing invocation of item dispatch listeners when forcing batching of mount items on Android (#45264) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45264 Changelog: [internal] We added a flag to fix some issues when committing state updates synchronously from the main thread in https://github.com/facebook/react-native/pull/44015 but that implementation was incorrectly not invoking item dispatch listeners after mount. This adds the missing logic so we can unblock shipping sync state updates. Reviewed By: javache Differential Revision: D59319230 fbshipit-source-id: b0ab7e7c79a3315ef29dbb024e62c10444192509 --- .../facebook/react/fabric/mounting/MountItemDispatcher.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java index 53c9ce0eb54..22dc4a682c0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java @@ -117,6 +117,11 @@ public class MountItemDispatcher { } finally { mInDispatch = false; } + + // We call didDispatchMountItems regardless of whether we actually dispatched anything, since + // NativeAnimatedModule relies on this for executing any animations that may have been + // scheduled + mItemDispatchListener.didDispatchMountItems(); } else { final boolean didDispatchItems; try {