Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Both mark work as non-urgent so React keeps urgent updates like typing responsive; useTransition wraps a state update you trigger, useDeferredValue gives you a lagging copy of a value you receive.
With useTransition you wrap a state update in startTransition, for example switching tabs that render a heavy view; React can interrupt that render to handle input, and isPending lets you show a subtle indicator instead of freezing. useDeferredValue is for when you get a value as a prop or from state that you don't update yourself: const deferredQuery = useDeferredValue(query) lets an input show the latest text while a slow list renders with the previous query until it catches up. Neither reduces the amount of work; they change its priority, so expensive rendering may still need memoization.