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

Trying to setState when unmounted #3

Open
mogelbrod opened this issue Jun 3, 2019 · 0 comments
Open

Trying to setState when unmounted #3

mogelbrod opened this issue Jun 3, 2019 · 0 comments

Comments

@mogelbrod
Copy link

use-measure@0.2.2

This error happens in our app when a component using use-measure is unmounted due to a resize:

use-measure.js:46: Warning: 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 a useEffect cleanup function.

Line 46 maps to the setContentRect(entry.contentRect) call inside the rAF closure. I'm guessing the rAF request isn't cancelled in time?

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