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

unmountComponentAtNode doesn't unbind in-flight listeners, throws opaque error. #4892

Closed
lutherism opened this issue Sep 16, 2015 · 3 comments

Comments

@lutherism
Copy link

Our React app was triggering the following error during navigation events:

Uncaught TypeError: Cannot read property 'firstChild' of undefined

The error was occurring in the function findComponentRoot, when it failed to find a component for an event callback.

In our app, this was happening when we would navigate during a blur event, and call unmountComponentAtNode on the rendering, in order to refresh the page. The docs for unmountComponentAtNode say

Remove a mounted React component from the DOM and clean up its event handlers and state

However, this does not seem to be the case. After we refresh the page with unmountComponentAtNode, there were other React-bound callbacks still in React's queue for that event. Leading to the error.

The docs and intuition seem to imply unmountComponentAtNode should clear these callbacks, since it knows the components will no longer exist to handle them.

@lencioni
Copy link
Contributor

Is this perhaps a duplicate of #3298 and #2605?

@lutherism
Copy link
Author

P

On Thu, Nov 12, 2015 at 10:04 AM Joe Lencioni notifications@github.com
wrote:

Is this perhaps a duplicate of #3298
#3298 and #2605
#2605?


Reply to this email directly or view it on GitHub
#4892 (comment).

@aweary
Copy link
Contributor

aweary commented Sep 20, 2017

Since there's no repro provided and there's been no activity for almost 2 years, I'm going to close this out. If this is still an issue with the latest version of React, please provide an example reproduction the issue so we can verify.

Thanks!

@aweary aweary closed this as completed Sep 20, 2017
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

3 participants