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 listeners probably must be cleaned on component unmount as well. #15

Open
vibecode opened this issue Jul 9, 2019 · 0 comments
Open

Comments

@vibecode
Copy link

vibecode commented Jul 9, 2019

Using create-react-app I got stumbled upon a warning saying 'Can't perform a React state update 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.'

This happens when you have changed some code and then the slider was being moved before live reloading actually happened. As I can see currently event listeners are being cleaned on 'mouseup' event only. Despite the situation when component was unmounted before the 'mouseup' event actually happened may seem unlikely in production, it can't be ruled out completely. So I believe all the listeners should be cleaned in the 'componentWillUnmount' as well.

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

1 participant