0
Challenge · 97React 19 Frontier

useDeferredValue

React 19used in ~20% of apps

Filtering a 10,000-row list on every keystroke makes the input itself stutter — you type 'react' and the letters appear half a second late. useDeferredValue lets the input stay instant while the expensive re-render lags a beat behind, with no delay number to guess and no frozen keyboard.

Core idea. useDeferredValue returns a copy of a value that intentionally lags behind during urgent updates: the input renders immediately with the new value while the heavy work re-renders in the background off the deferred (older) value, and React can interrupt that background render if you keep typing.
Playground, this isn't a screenshot
URGENT INPUT — TYPE FAST, IT STAYS INSTANT
user's device
deferred catch-up: ~160ms
useDeferredValue(query)in sync
re
expensive list — 9 rows (re-renders off the deferred copy)
reactreact-routerreact-queryreduxredux-toolkitrecoilremixexpressprettier
no fixed delay · interruptible · tracks the device
debounce(query, 500)in sync
re
same fixed 500ms wait on every device — even on the fast laptop the list never updates while you keep typing
fixed delay you guessed · waits for a pause

The input is always instant. The deferred copy lags just long enough to re-render the heavy list, then snaps in sync — switch to slow phone and watch it wait longer, all on its own. The debounced copy always waits the same hardcoded 500ms.

Model of the timing only: the real hook uses React's scheduler (not a timer), so its "delay" is however long the background render takes — never a value you pick.

↑ play a little first, then dig in