Capítulo 52 de 116
useDeferredValue(value, initialValue?) returns a version of value that React is allowed to update "later" (at lower priority) than the value itself, letting an expensive-to-render child lag slightly behind an urgent input like typing, instead of blocking it.
const deferredValue = useDeferredValue(value, initialValue?). On the very first render, deferredValue equals initialValue if provided, otherwise value. On updates, React first tries to re-render with the old deferred value, then schedules a second, lower-priority re-render with the new one.memo for the real payoff: deferring the value alone doesn't skip re-rendering the child that consumes it; wrapping that child in memo (Ch 88) lets React actually skip re-rendering it while the deferred value hasn't caught up yet, since its props haven't changed.deferredValue !== value while the deferred update is pending, that comparison can drive a visual cue (reduced opacity, a subtle "updating" indicator) on the lagging content.function SearchPage({ query }) {
const deferredQuery = useDeferredValue(query);
return <SearchResults query={deferredQuery} />; // wrap SearchResults in memo for full benefit
}
query) stays instantly responsive while SearchResults receives a value React is free to update slightly later.useDeferredValue protects urgent rendering (typing, direct input feedback) from being blocked by expensive downstream rendering — it doesn't make the downstream rendering itself faster.memo on the consuming component is what actually lets React skip wasted renders while waiting to catch up — without it, the deferred value still causes a re-render, just a lower-priority one.useState.