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

Event dispatch fails after unmounting #7733

Closed
vsiao opened this issue Sep 14, 2016 · 3 comments
Closed

Event dispatch fails after unmounting #7733

vsiao opened this issue Sep 14, 2016 · 3 comments

Comments

@vsiao
Copy link
Contributor

vsiao commented Sep 14, 2016

What is the current behavior?
Repro: https://jsfiddle.net/s8fg30fx/

  • Click "Click Me!"
  • Fails with "React DOM tree root should always have a node reference."

What is the expected behavior?
No failure, and event dispatch stops.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
15.3.1, Chrome 52+ OS X
Not certain if this has worked before.

Maybe related: #7103 and #7661

@zpao
Copy link
Member

zpao commented Sep 14, 2016

cc @spicyj @sebmarkbage

@sebmarkbage
Copy link
Collaborator

If you do this in the DOM you would get both events fired. Similarly if we defer DOM operations to a later schedule, that's also what would happen. I think that's the semantics we would want for this. Not a super high priority to fix this though.

The solution is to call event.stopPropagation(); in the inner handler.

@sophiebits
Copy link
Collaborator

Dupe of #3298 I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants