You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because it returns a Ref, the only thing I'm left to destructure is value: const { value } = useQueries...
I understand there are alternatives and workarounds, but I love the convenience of being able to destructure from the hook itself. Is there any reason the data returned needs to be structured in this way? I was under the impression that using combine in a useQueries hook should make it able to be consumed as it if were from a useQuery.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In
vue-query, theuseQueryhook returns an object ofRefs that is easy to destructure from (similar to React examples), without losing any reactivity.However, when using the
useQuerieshook together with thecombinecallback, the return type becomes aRefitself. This makes it tricky to work with.Consider the following example:
Because it returns a
Ref, the only thing I'm left to destructure isvalue:const { value } = useQueries...I understand there are alternatives and workarounds, but I love the convenience of being able to destructure from the hook itself. Is there any reason the data returned needs to be structured in this way? I was under the impression that using
combinein auseQuerieshook should make it able to be consumed as it if were from auseQuery.Beta Was this translation helpful? Give feedback.
All reactions