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

cancel all subscriptions and asynchronous tasks in the componentWillUnmount method #8

Closed
edwardfxiao opened this issue Apr 26, 2018 · 4 comments

Comments

@edwardfxiao
Copy link
Collaborator

I've encountered this problem

image

Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in ReactMinimalPieChart (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in div (created by Index)
in Index (created by Connect(Index))
in Connect(Index) (created by AsyncRoute)
in AsyncRoute (created by Route)

Not sure if is the component issue. If it is, maybe you can cancel the asynchronous tasks in the componentWillUnmount?

Thx

@toomuchdesign
Copy link
Owner

Hi @edwardfhsiao!
Good catch. I'm quite sure it comes from the component. All the evidences point to the starting animation, which is triggered asynchronously in componentDidMount hook. I'm on it, I'll release a patch, soon.

Thank you. Cheers!

@toomuchdesign
Copy link
Owner

Hi @edwardfhsiao!
What do you think about this PR?

Could it fix the issue?
Cheers!

@edwardfxiao
Copy link
Collaborator Author

yes I think so

@toomuchdesign
Copy link
Owner

Fixed by #9.

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