React · Middle · Question 24 of 75
When should you use useDeferredValue?
- ✓Correct answer: When heavy UI depends on a rapidly changing value
- 2When you need to defer loading a component's code until a click
- 3When you need to delay an update by a fixed time
Explanation
const deferredQuery = useDeferredValue(query) - the input updates immediately, while the heavy list renders with a "lagging" value in the background and is interrupted by new keystrokes. Unlike debounce, there's no fixed delay: on a fast device the lag is almost zero.