Closed ppxb closed 4 years ago
in function loginUser if you write like this
if (!!username && !!password) { setTimeout(() => { localStorage.setItem('id_token', 1) dispatch({ type: 'LOGIN_SUCCESS' }) setError(null) setIsLoading(false) histroy.push('/app/dashboard') }, 2000) }
may call a warning likes 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 a useEffect cleanup function.
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 a useEffect cleanup function.
but write like this
if (!!username && !!password) { setTimeout(() => { localStorage.setItem('id_token', 1) setError(null) setIsLoading(false) dispatch({ type: 'LOGIN_SUCCESS' }) histroy.push('/app/dashboard') }, 2000)
it will not.
Hi there!
Thanks for your help!
We've already pushed a commit that contains your implementation of the React error message
in function loginUser if you write like this
may call a warning likes
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 a useEffect cleanup function.
but write like this
it will not.