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
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.
const { refetch } = useQuery(...)
i believeok lemme try that
yup thanks
oh it was there I'm blind