React · Middle · Question 24 of 75

When should you use useDeferredValue?

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.

Further reading

Problem with a question

React · Middle · question 24

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz