-
-
Notifications
You must be signed in to change notification settings - Fork 437
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 perform a React state update on an unmounted component #3
Comments
Hi @raelb ! I was stuck in the same problem and after some research I understand that the I edited the code like this, and it works:
This answer enlighted me, but I'd like to know if my conclusions are right :) |
I had the same problem, but my issue was that I was using the de-structuring curly braces when setting
It's an easy mistake given that so many hooks require de-structured assignment syntax. e.g. React-Firebase-Auth/src/components/Dashboard.js Lines 7 to 9 in c355408
|
I'm getting same error while using REST API Login. How can I use useEffect function while working with API. `export function AuthProvider({ children }) {
}` |
@dhruvangg I would try moving the async login handling to Login.js. Only return the The problem with that is that you will need a way to In other words, you probably don't need I suppose you could useEffect in Login.js and set it's dependency to |
Good progress. Keep up the good work. |
Hi Kyle, Thanks for the super tutorial.
I just wanted to point out, when you move from the login page to the dashboard, the console shows a warning:
It looks like the problem is caused (in Login.js) by setting state after call to
history.push
which already moves to the Dashboard component.Is the correct solution to just remove call to
setLoading
, or is there a better solution?The text was updated successfully, but these errors were encountered: