Capítulo 90 de 116
startTransition(scope) is the standalone-function form of useTransition's startTransition — same low-priority-update behavior, usable outside component/Hook context, but without the accompanying isPending flag.
startTransition(() => { setState(...); }) — marks the state update(s) inside scope as a transition, exactly like the function returned by useTransition().useTransition's version: this standalone import has no associated isPending boolean — use it when you need to mark an update as low-priority but don't need to render a pending indicator, or when calling from outside a component (e.g. a module-level utility function that isn't itself a Hook context).useTransition instead: any time a pending indicator (spinner, disabled state) needs to reflect whether the transition is still in flight — that requires the Hook form's isPending, which this standalone function doesn't provide.import { startTransition } from 'react';
function handleClick() {
startTransition(() => {
setTab('comments'); // marked low-priority, no isPending available here
});
}
useTransition, used where no pending UI feedback is needed.useTransition (Ch 65) whenever you need to show pending state; reach for the standalone startTransition only when you specifically don't need isPending.useTransition.isPending flag.