T
TanStack13mo ago
conscious-sapphire

How i can await revalidation in other component?

I have a react-query request hook with a specific key. I invalidate this request by key in certain circumstances. But in another component I need to await data is successfully received, can I somehow do await? I tried to do this via queryClient, but nothing worked for me. Can you please tell me the way?
2 Replies
sunny-green
sunny-green13mo ago
Should work fine with await queryClient.invalidateQueries({ queryKey: ['your-key'] })
conscious-sapphire
conscious-sapphireOP13mo ago
it's just revalidate, i expect a promise to know exactly when the revalidation will end and the data will be up to date or something else

Did you find this page helpful?