State Management · Middle · Question 72 of 75

Why update search params with { replace: true } while the user types a filter?

setSearchParams({ q: value }, { replace: true });

Explanation

Push a new entry only for meaningful navigations (e.g. submitting a search). Debouncing the update reduces loader calls too.

Further reading

Problem with a question

State Management · Middle · question 72

Test yourself

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

Take this quiz