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
This commit is contained in:
Rubén Norte
2024-07-03 05:01:02 -07:00
committed by Facebook GitHub Bot
parent 3c6762a5f8
commit 8db2995934
@@ -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 {