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
extended-salmon•9mo ago
Should work fine with
await queryClient.invalidateQueries({ queryKey: ['your-key'] })
subsequent-cyanOP•9mo 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