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

Listeners "leak" and increasing nodes after unmountComponentAtNode #11852

Closed
raed667 opened this issue Dec 14, 2017 · 4 comments
Closed

Listeners "leak" and increasing nodes after unmountComponentAtNode #11852

raed667 opened this issue Dec 14, 2017 · 4 comments

Comments

@raed667
Copy link

raed667 commented Dec 14, 2017

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

What is the current behavior?

When I render a very simple React app using ReactDOM.render then ReactDOM.unmountComponentAtNode several times I get the following chart with what looks like an increasing number of listeners and nodes in my application.

react_empty

Here is a fiddle of what I'm doing : https://jsfiddle.net/ugy84ap0/

What is the expected behavior?

I think after unmountComponentAtNode my graph should be flat ?

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

I'm using latest create-react-app / "react": "16.2.0"

@gaearon
Copy link
Collaborator

gaearon commented Dec 14, 2017

Are you testing with the production version?

@raed667
Copy link
Author

raed667 commented Dec 14, 2017

@gaearon Thank you for the quick response.

The first screenshot is using DEV version. The fiddle is using the provided template.

I tried with yarn build and now it looks much smoother. Thank you.
react_build

Do you know what is causing this ?

(Closed)

@raed667 raed667 closed this as completed Dec 14, 2017
@gaearon
Copy link
Collaborator

gaearon commented Dec 15, 2017

I don't think it's a leak even in DEV. If you wait for GC it should get collected.

@raed667
Copy link
Author

raed667 commented Dec 21, 2017

You're right it just takes longer.

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

2 participants