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 handlers firing after unmount #7661

Closed
niole opened this issue Sep 5, 2016 · 6 comments
Closed

event handlers firing after unmount #7661

niole opened this issue Sep 5, 2016 · 6 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@niole
Copy link
Contributor

niole commented Sep 5, 2016

Do you want to request a feature or report a bug?

reporting a bug

What is the current behavior?

I'm working on a project which employs React as the view layer. I have a rather large tree of components. I ran into a bug the other day where the event which triggers click handler which ultimately unmounts the tree continues running rogue in React's DOM after the thing is unmounted and triggers other handlers. There's a simple workaround. I used event.preventDefault to avert any future crises.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).

I'm sure you can repro this with a little luck, enough components and no event management in your event handlers.

What is the expected behavior?

No event handlers should be triggerable after unmounting.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

browser: Chrome Version 52.0.2743.116 (64-bit)
os: Mac OS X 10.11.3
React version: 0.14.8

fiddle with (failed) repro:
https://jsfiddle.net/69z2wepo/68075/

@gaearon
Copy link
Collaborator

gaearon commented Sep 5, 2016

I'm sure you can repro this with a little luck, enough components and no event management in your event handlers.

Sorry, but this is unfortunately not very helpful, and will likely cause this issue to be low priority in our backlog. If something is not working as intended, please try to extract a reproducing example from your app and trim it down. It takes some time but it really helps us find the cause.

React version: 0.14.8

This is a rather old version, and many bugs have been fixed since it was released. Do you mind reproducing this with the most recent version? Thanks.

@gaearon gaearon added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Sep 5, 2016
@svieira
Copy link

svieira commented Sep 9, 2016

This sounds suspiciously similar to what we saw in #7128 / #7209 @gaearon

@aweary
Copy link
Contributor

aweary commented Jan 20, 2017

Going to close since there have been no updates and there was no reproducible example provided. @niole if this is still an issue with the most recent version of React please provide a small test case demonstrating the issue and we can re-open 👍

@aweary aweary closed this as completed Jan 20, 2017
@niole
Copy link
Contributor Author

niole commented Jan 22, 2017

It looks like React 15.4.2 throws an error, React DOM tree root should always have a node reference. if a React node tree is unmounted, which effectively keeps this bug from showing up if it still exists.

@aweary
Copy link
Contributor

aweary commented Jan 22, 2017

@niole as mentioned by @gaearon:

If something is not working as intended, please try to extract a reproducing example from your app and trim it down. It takes some time but it really helps us find the cause.

Without a reproducible example, there's not a lot we can do to help. But it sounds like you're encountering #3298

@niole
Copy link
Contributor Author

niole commented Jan 24, 2017

@aweary sorry, I should have been clearer. I cannot reproduce this because there is a new error thrown when a user unmounts a React component that may not have existed when I found this bug in React 0.14.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

4 participants