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

Clear items to show resize timeout when component unmounts (Issue #87) #198

Merged

Conversation

rlundquist3
Copy link
Contributor

@rlundquist3 rlundquist3 commented Aug 31, 2020

As described in issue #87 , there is an occasional error indicating a memory leak occasionally when the component mounts, especially (but not exclusively) when resizing.

Clearing this/these timeout(s) on unmount prevents the error.

Error:

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.

To most easily reproduce the problem without this change, resize the window while the page is loading.

  When the window is resized, timeout(s) with setState are set; these 
need to be cleaned up on unmount to prevent a potential memory leak
@rlundquist3 rlundquist3 mentioned this pull request Aug 31, 2020
Copy link

@kevinparkerson kevinparkerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@YIZHUANG
Copy link
Owner

@all-contributors please add @rlundquist3 for code

@allcontributors
Copy link
Contributor

@YIZHUANG

I've put up a pull request to add @rlundquist3! 🎉

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

Successfully merging this pull request may close these issues.

None yet

5 participants