T
TanStack3y ago
xenial-black

How to use `useQuery` on route change?

I'd like to refetch data if a route parameter has changed and I tried using vue-router's onBeforeRouteUpdate hook in the setup function but it gives me an error saying Error: vue-query hooks can only be used inside setup() function.. Is there a suggested way to achieve the same functionality? Should I watch the route object instead?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?