State Management · Junior · Question 63 of 75

How do you manually refetch a query, e.g. from a "Refresh" button?

Explanation

To refresh every component using the data, invalidating the key with queryClient.invalidateQueries is often more idiomatic.

Further reading

Problem with a question

State Management · Junior · question 63

Test yourself

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

Take this quiz