Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore RN events on unknown nodes #12264

Merged
merged 1 commit into from Feb 21, 2018
Merged

Conversation

sophiebits
Copy link
Collaborator

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.

@sophiebits
Copy link
Collaborator Author

cc @fkgozali

@@ -31,6 +31,9 @@ const ReactNativeBridgeEventPlugin = {
nativeEvent: AnyNativeEvent,
nativeEventTarget: Object,
): ?Object {
if (targetInst == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use an inline comment about the case it's intended to handle. I'm not really familiar with this particular code, but it would not be obvious to me at a glance why it was okay to silently ignore this case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.
@sophiebits sophiebits merged commit b17e4c2 into facebook:master Feb 21, 2018
LeonYuAng3NT pushed a commit to LeonYuAng3NT/react that referenced this pull request Mar 22, 2018
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.
rhagigi pushed a commit to rhagigi/react that referenced this pull request Apr 19, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants