[vue-query] Using useQuery composable from separate package #8058
Replies: 1 comment
-
Solved - I had Vue set as a normal dependency instead of a peerDependency in my shared package, so it was creating two Vue instances |
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 all, typically when I use vue-query I bundle my queries into composables so they can be re-used like so:
This works great for keeping a data layer separate from the main component code. Recently I've been trying to go a step further and pull these composables into a shared library so multiple Vue apps can use them, to no avail. Example:
With this example, vue-query doesn't believe it's being instantiated within a
setup()
function, so it throws these errors:Any ideas why useQuery can't grab the setup context in this example?
Beta Was this translation helpful? Give feedback.
All reactions