React·Advanced·Coding·1 min read
What happens when already visible content suspends during an update?
Short interview answer
React may show the nearest fallback unless the update is marked non-urgent, for example with a transition, allowing current content to remain while new content prepares. The exact experience depends on boundary and cache behavior.
Example
const [isPending, startTransition] = useTransition();startTransition(() => setQuery(next)); // keep old results visible, // isPending drives a subtle spinnerKey takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.