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
This commit is contained in:
Rubén Norte
2024-08-29 20:57:25 -07:00
committed by Facebook GitHub Bot
parent a2d53d5ea0
commit dbe2b38172
@@ -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. */