Created
August 25, 2021 11:22
-
-
Save Hydrock/7b34551b51a9fdf6c057a9447accc402 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
const App = () => { | |
// ... | |
const [isPending, startTransition] = useTransition({ timeoutMs: 2000 }); | |
startTransition(() => { | |
setSearchQuery(input); | |
}); | |
// ... | |
return ( | |
<span> | |
{isPending ? " Loading..." : null} | |
{/* ... */} | |
</span> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment