mozzius
mozzius14mo ago

React Native/Expo: Uncaught Error: No QueryClient set, use QueryClientProvider to set one

Found this issue but it just says to use patch-package, I was wondering if there was any changes since then? https://github.com/TanStack/query/discussions/4619
GitHub
Expo + trpc +_ reactQuery: Uncaught Error: No QueryClient set, use ...
Describe the bug I decided to use expo + trpc stack. But I have some issues with react-query used under the hood of trpc. The courios thing is that iOS build is working fine but not web configurati...
Solution:
```typescript import { defaultContext } from "@tanstack/react-query" export const api = createTRPCReact<AppRouter>({ reactQueryContext: defaultContext,...
Jump to solution
3 Replies
mozzius
mozzius14mo ago
I think I may have solved it by doing this:
Solution
mozzius
mozzius14mo ago
import { defaultContext } from "@tanstack/react-query"

export const api = createTRPCReact<AppRouter>({
reactQueryContext: defaultContext,
});
import { defaultContext } from "@tanstack/react-query"

export const api = createTRPCReact<AppRouter>({
reactQueryContext: defaultContext,
});
mozzius
mozzius14mo ago
need to solve unrelated errors first before I can say for sure though yeah I can confirmed this worked