Ignore RN events on unknown nodes (#12264)
If we have multiple RN renderers running simultaneously, we should be able to send a single event to all of them and only if it recognizes the event will it do anything with it. Crucially, this avoids the 'Unsupported top level event type "%s" dispatched' invariant in those cases.
This commit is contained in:
parent
48ffbf06be
commit
b17e4c204e
|
@ -31,6 +31,10 @@ const ReactNativeBridgeEventPlugin = {
|
|||
nativeEvent: AnyNativeEvent,
|
||||
nativeEventTarget: Object,
|
||||
): ?Object {
|
||||
if (targetInst == null) {
|
||||
// Probably a node belonging to another renderer's tree.
|
||||
return null;
|
||||
}
|
||||
const bubbleDispatchConfig = customBubblingEventTypes[topLevelType];
|
||||
const directDispatchConfig = customDirectEventTypes[topLevelType];
|
||||
invariant(
|
||||
|
|
Loading…
Reference in New Issue