Enable query on click and get updated data in same function
3 Replies
stormy-goldOP•3y ago
how can I get data in after refetch
extended-salmon•3y ago
refetch return type is Promise<UseQueryResult>. So you can do:
I don't know what the end goal is but instead of calling refetch() I would probably look into setting enabled to true and using the data returned by useQuery though.stormy-goldOP•3y ago
I am getting data, I am not setting any query params to enable query based on params so I an refetching on click. after fetch I want to make a custom logic in the function