Created
June 7, 2022 14:29
-
-
Save adityatyagi/4c4302eaac13f18a44296d836b60bdec to your computer and use it in GitHub Desktop.
This file contains 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
// Button 1 | |
const updateLoading = () => { | |
setIsLoading(true); | |
// ... | |
// state is not updated here | |
// ... | |
setIsLoading(false); | |
// ... | |
// state is not updated here | |
// ... | |
setIsLoading(true); | |
// it will still print "false" | |
console.log(isLoading); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment