-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
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. #772
Comments
Hi @josoroma, I can not see all of your code so I am making a couple of assumptions, this looks like a login form and I'm assuming that you are redirecting on successful authentication? And after the redirect something within the component is setting state. Kent C. Dodds recently did a video which shows you how to prevent this from happening here: The simplest way to prevent the warning would be to do the following: and before you call the setState wrap it in a conditional to make sure the component is mounted :) |
I thought this was fixed here? I am getting this same still when unmounting the form after submission |
Hrmmm |
Hi! I'm having same error. I'm using formik together with react-apollo. Truncated example of code:
Debugger sends me inside 'formik.esm.js' on this line:
As I see, mutation |
I had a similar case where I had a |
Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal. |
ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it. |
How to automatically unsubscribe after we have a response?
Thanks in advance!
The text was updated successfully, but these errors were encountered: