From dbe2b3817297cf462a51dab302c7c4433fa3bf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 29 Aug 2024 20:57:25 -0700 Subject: [PATCH] Remove unnecessary null check from FabricEventDispatcher (#46268) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46268 Changelog: [internal] `mReactEventEmitter` is final and initialized with a non-null value in the constructor, so this check is redundant. Reviewed By: sammy-SC Differential Revision: D62004021 fbshipit-source-id: bb8719c286cd04005370f2cdef89928c0d01007a --- .../react/uimanager/events/FabricEventDispatcher.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java index ce8520ebcaa..73a092651f6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java @@ -89,16 +89,7 @@ public class FabricEventDispatcher implements EventDispatcher, LifecycleEventLis } private void maybePostFrameCallbackFromNonUI() { - if (mReactEventEmitter != null) { - // If the host activity is paused, the frame callback may not be currently - // posted. Ensure that it is so that this event gets delivered promptly. - mCurrentFrameCallback.maybePostFromNonUI(); - } else { - // No JS application has started yet, or resumed. This can happen when a ReactRootView is - // added to view hierarchy, but ReactContext creation has not completed yet. In this case, any - // touch event dispatch will hit this codepath, and we simply queue them so that they - // are dispatched once ReactContext creation completes and JS app is running. - } + mCurrentFrameCallback.maybePostFromNonUI(); } /** Add a listener to this EventDispatcher. */