-
Notifications
You must be signed in to change notification settings - Fork 144
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: setState(). Can only update a mounted or mounting component #21
Comments
Hmm good catch. @Umar-Abbas would you want to take a look at this? |
+1 |
1 similar comment
+1 |
Running into the same issue, anyone managed to solve this? I only get this error when invalid credentials are submitted by Meteor.loginWithPassword() |
Made updates in #39 and didn't see this happening any more. Let me know if that's not the case! |
Unfortunately it is still not working for me. I still cant get past creating an account, because I get this message. Updated to the newest version of the boilerplate. Using |
It only happens when signing in with an email address that doesn't exist I believe. But the screen is littered with warnings in any case of all different types. |
Not sure why it's taken me this long to realize but the What's happening is that when you press sign in/up with incorrect values the callback is being handled and setting the error state. The problem here is that when you press login/createAccount you set I'll do some thinking around how to fix this - at least now we know where the problem is originating from! |
@elie222 as for the usage of In an ideal world (like in production apps) we would use a single global store, like Redux, to keep all of our state but that's got a larger learning curve involved. |
Also, @elie222, what other warnings/errors are you seeing? If they're unrelated to this one please open a new issue! I want to make sure everything is working well 😄 |
Should be good to go now 👍 |
Cool. Thanks! |
I just realised there's still a problem here. Sometimes it shows the error, and sometimes the screen just flashes and the email/password field just go blank with no error message shown. Seems like the issue is due to what you wrote above:
The screen loads, the component gets unmounted, and all state is wiped. |
My current hacky/fix is changing this line: But now you get a flash of the login screen when you open the app and you're logged in, so that's not great either. |
I get this warning after logging in on iOS:
Warning: setState(). Can only update a mounted or mounting component
The text was updated successfully, but these errors were encountered: