Skip to content

useDeferredValue

In one line

useDeferredValue lets you defer a prop/value so the UI stays responsive during expensive recomputations.

In simple words

useDeferredValue (React 18) takes a value and returns a deferred version of it. React keeps using the old value for rendering while working on the new one in the background.

This is useful when a value comes from props or parent state and you can't wrap the update in startTransition. The deferred value updates at lower priority — if an urgent update comes in, React can interrupt.

The classic use case is a search input where the parent holds the query and a child does expensive filtering. The child defers the query prop so typing stays smooth.

Example

jsx
import { useDeferredValue, useMemo } from "react";

function FilteredList({ items, query }) {
  const deferredQuery = useDeferredValue(query);
  const filtered = useMemo(
    () => items.filter(i => i.includes(deferredQuery)),
    [items, deferredQuery]
  );
  return <ul>{filtered.map(i => <li key={i}>{i}</li>)}</ul>;
}

function Parent() {
  const [query, setQuery] = useState("");
  return (
    <>
      <input value={query} onChange={e => setQuery(e.target.value)} />
      <FilteredList items={hugeList} query={query} />
    </>
  );
}

The input updates immediately. The child defers the query prop, so it keeps showing old results while computing new ones — typing stays smooth.

Common confusions

  • Confused with: useTransition

    The difference: useDeferredValue defers a value you receive (from props/state) — you don't control when it starts. useTransition wraps a state setter — you explicitly start the transition. Use useDeferredValue for received values, useTransition for updates you trigger.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary