-
Hi, export function Test() {
const user = trpc.user.getCurrent.useQuery().data;
console.log("user in Test", user);
return <div>{user?.fullname}</div>;
} The query doesn't ever refetch. I just worked 3 hours on this without making any progress, what could cause this ? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I can only say that it should work, and I can take a look if you can reproduce this in a stackblitz or codesandbox |
Beta Was this translation helpful? Give feedback.
-
Ok, i have found my mistake (after too many hours on this). <trpc.Provider client={trpcClient} queryClient={queryClient}>
<App/>
</trpc.Provider> (so forgetting to wrap a second time with |
Beta Was this translation helpful? Give feedback.
Ok, i have found my mistake (after too many hours on this).
If you wrap your app like this with trpc + query
(so forgetting to wrap a second time with
<QueryClientProvider client={queryClient}>
It will seems to work. You won't receive any error message. queries will run, invalidate, rerun when invalidated or remounted. But not refetch on refocus.
I will see that with them, thank you.