State Management · Junior · Question 63 of 75
How do you manually refetch a query, e.g. from a "Refresh" button?
- ✓Correct answer: Call the
refetchfunction returned byuseQuery - 2Call
useQueryagain in the click handler - 3Reload the page
Explanation
To refresh every component using the data, invalidating the key with queryClient.invalidateQueries is often more idiomatic.