Created
June 11, 2020 11:30
-
-
Save dagda1/3d4533cd3eef676f5264335a770068e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
let didCancel = false; | |
// ... | |
// you can check didCancel | |
// before running any setState | |
// ... | |
return () => { | |
didCancel = true; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment