mirror of
https://github.com/status-im/react-native.git
synced 2025-01-30 11:14:49 +00:00
Fix race condition when clicks are received on react root view and react context is pending
Reviewed By: astreet Differential Revision: D3297574 fbshipit-source-id: 27ac81342d19947e9425a845d7ef7c73cc4cf090
This commit is contained in:
parent
cc683bc088
commit
fd376660df
@ -119,9 +119,16 @@ public class EventDispatcher implements LifecycleEventListener {
|
||||
event.getEventName(),
|
||||
event.getUniqueID());
|
||||
}
|
||||
// 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();
|
||||
if (mRCTEventEmitter != 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.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user