Skip to content

Instantly share code, notes, and snippets.

@Hydrock
Created August 25, 2021 11:19
Show Gist options
  • Save Hydrock/82803d787343c736e2cee40290b2c96a to your computer and use it in GitHub Desktop.
Save Hydrock/82803d787343c736e2cee40290b2c96a to your computer and use it in GitHub Desktop.
import { startTransition } from "react";
// ...
// Urgent -> show updated input
setInputValue(input);
// Transition (non-urgent) -> show search
startTransition(() => {
setSearchQuery(input);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment