onSuccess for useQuery #9237
Unanswered
itsmahmoud-dev
asked this question in
Ideas
Replies: 1 comment 3 replies
-
We've had this in the past and it was bad. Have a read here on why we removed it: https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can we have an
onSuccess
function foruseQuery
like the one foruseMutation
. What I'm thinking of is a function that runs when the query finishes successfully, one solution is to auseEffect
withisSuccess
condition to run the function. But what if I want to invalidate this query from another page and have itsonSuccess
function run automatically when the refetching finishes.Beta Was this translation helpful? Give feedback.
All reactions