Created
February 1, 2023 03:27
-
-
Save vinnymac/eb0b5082b4bab8f19f590a85fcb51e61 to your computer and use it in GitHub Desktop.
React 18 Flush Sync
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
import { flushSync } from 'react-dom'; | |
flushSync(() => { | |
currentEl.focus(); | |
setFocused(false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment