0PricingLogin
React Academy · Lesson

useDeferredValue for Input Debouncing

Delay re-renders of slow parts of the UI while keeping input snappy.

Welcome

In this lesson you will use useDeferredValue to delay re-rendering of expensive parts of the UI while keeping controlled inputs snappy and responsive.

What Is useDeferredValue?

useDeferredValue accepts a value and returns a deferred version of it. The deferred value lags behind the current value during urgent renders, allowing React to update the UI in two steps: fast for input, deferred for expensive output.
const [query, setQuery] = useState('');
const deferredQuery = useDeferredValue(query);
// query updates immediately on keystroke
// deferredQuery updates when React has capacity

All lessons in this course

  1. Racing Conditions & Effect Cleanup
  2. useTransition for Non-Blocking UI Updates
  3. useDeferredValue for Input Debouncing
  4. Suspense for Data & Code Boundaries
← Back to React Academy