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

Throws a warning when component is unmounted before the debounced function executes #5

Closed
mjhm opened this issue Apr 2, 2018 · 4 comments

Comments

@mjhm
Copy link
Contributor

mjhm commented Apr 2, 2018

No description provided.

mjhm added a commit to mjhm/react-debounce-render that referenced this issue Apr 2, 2018
@mjhm
Copy link
Contributor Author

mjhm commented Apr 2, 2018

@podefr Thank you for this tool, it's saved me from some annoyingly slow form updates.

I'm running into this minor problem though sometimes when I'm navigatating off a page:

When the debounced component is unmounted before the final debounced function execution we get React warnings that look like: Warning: Can't call setState (or forceUpdate) on an unmounted component.

For example see the test case in #6

@podefr
Copy link
Owner

podefr commented Apr 2, 2018

Thanks so much @mjhm for raising the issue and suggesting a fix, I'll take a look at the pull request shortly!

podefr pushed a commit that referenced this issue Apr 4, 2018
@podefr
Copy link
Owner

podefr commented Apr 4, 2018

Thanks @mjhm I just pushed v4.0.1 with the fix. Let me know if it closes the issue!

@mjhm
Copy link
Contributor Author

mjhm commented Apr 4, 2018

Warning all gone! Thank you!

@mjhm mjhm closed this as completed Apr 4, 2018
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