mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Queue the event for preallocated but not mounted view to dispatch later
Summary: This diff fixed an edge case that event dispatching is failed after pre-allocation of a view and before the view is mounted. When a cached image is loaded, we will dispatch the event to JS immediately. This is could happen after the view is created during pre-allocation phase, when the event emitter is not instantiated yet. In that case, we will see [an error](https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java#L927) and the event will effectively be ignored. To fix that we introduced a queue in this diff for those events. They will be dispatched in order when the view is mounted and the event emitter is non-null. Changelog: [Android][Fixed] - Fixed an edge case that event dispatching is failed after pre-allocation of a view and before the view is mounted. Reviewed By: mullender Differential Revision: D36331914 fbshipit-source-id: cd065b0b36978cb5f0aac793d8d16f07a48f0881
This commit is contained in:
committed by
Facebook GitHub Bot
parent
644fe430fd
commit
a093fe5f2f
@@ -111,6 +111,9 @@ public class ReactFeatureFlags {
|
||||
|
||||
public static boolean dispatchPointerEvents = false;
|
||||
|
||||
/** Feature Flag to enable the pending event queue in fabric before mounting views */
|
||||
public static boolean enableFabricPendingEventQueue = false;
|
||||
|
||||
/** Feature Flag to control RN Android scrollEventThrottle prop. */
|
||||
public static boolean enableScrollEventThrottle = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user