-
Let 's look at the following useQuery(["some-key", value], queryFn, {
staleTime: Infinity,
onSuccess (data) {
doSomethingWithData(data)
}
}) If
Though it feels think there is an event "missing" that should fire whenever I assume I could write a const { data, isSuccess } = useQuery(["some-key", value], queryFn, {
staleTime: Infinity
})
useEffect(() => {
if (isSuccess) {
doSomethingWithData(data)
}
}, [data, isSuccess]) What do you think? Is an event "missing" or is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
we had that discussion a couple of days ago (#2911) and we actually wanted to add another |
Beta Was this translation helpful? Give feedback.
we had that discussion a couple of days ago (#2911) and we actually wanted to add another
onDataChanged
callback, but then decided against it, becausedata
is stable anduseEffect
is essentially what you want. see: #2964