how do you re-fetch with react-query?

it seems that they don't have such action: useQuery(queryKey, queryFn?, { cacheTime, enabled, networkMode, initialData, initialDataUpdatedAt, isDataEqual, keepPreviousData, meta, notifyOnChangeProps, onError, onSettled, onSuccess, placeholderData, queryKeyHashFn, refetchInterval, refetchIntervalInBackground, refetchOnMount, refetchOnReconnect, refetchOnWindowFocus, retry, retryOnMount, retryDelay, select, staleTime, structuralSharing, suspense, useErrorBoundary, })
3 Replies
venego
venegoOP3y ago
I don't wanna use SWR but I need something like this:
Revalidate You can get the mutate function from the useSWRConfig() hook, and broadcast a revalidation message globally to other SWR hooks* using the same key by calling mutate(key).
This example shows how to automatically refetch the login info (e.g. inside <Profile/>) when the user clicks the “Logout” button.
cornflour
cornflour3y ago
const { refetch } = useQuery(...) i believe
venego
venegoOP3y ago
ok lemme try that yup thanks oh it was there I'm blind
Want results from more Discord servers?
Add your server