mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make sure we only queue events when event emitter is null
Summary: This diff adds an assertion to make sure the pending events are enqueued only when the event emitter is null. This is to avoid unexpected workflow when we queue events but we should just dispatch them. Changelog: [Android][Internal] - Make sure we only queue events when event emitter is null Reviewed By: javache Differential Revision: D36916482 fbshipit-source-id: fff305615b302ece26bc2482c826b74de4f70266
This commit is contained in:
committed by
Facebook GitHub Bot
parent
77e6bff629
commit
472e0e4a3c
+4
@@ -1103,6 +1103,10 @@ public class SurfaceMountingManager {
|
||||
// Cannot queue event without view state. Do nothing here.
|
||||
return;
|
||||
}
|
||||
Assertions.assertCondition(
|
||||
viewState.mEventEmitter == null,
|
||||
"Only queue pending events when event emitter is null for the given view state");
|
||||
|
||||
if (viewState.mPendingEventQueue == null) {
|
||||
viewState.mPendingEventQueue = new LinkedList<>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user