Replies: 2 comments 1 reply
-
Hi 👋 I'm not a Vue user but it seems odd to attempt to mutate the data property of a query. Why are you trying to do this? The typical approach is to intercept the network request using a tool like Mock Service Worker. |
Beta Was this translation helpful? Give feedback.
1 reply
-
If you are using the Good const Test = defineComponent({
const { data } = useQuery({...})
setup() {
return () => <div>{data}</div>
},
}) Bad const Test = ()=> {
const { data } = useQuery({...})
return <div>{data}</div>
} But I don't like to using |
Beta Was this translation helpful? Give feedback.
0 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.
-
Hi,
I am pretty stuck for a while now with trying to integrate @tanstack/vue-query into our project. The runtime code works but I am struggling with refactoring our unit tests that now have to use tanstack query.
I am trying to directly modify the
data
ref returned by useQuery, but I get this error:Error: vue-query hooks can only be used inside setup() function.
which makes sense in some way, but I can't wrap my head around a solution. Is there anyone facing the same issue or has already a solution?Many thanks :)
Beta Was this translation helpful? Give feedback.
All reactions