QueryClient not found

I am using react query in the content script This is how my code looks like, and it's even "working". But I still get this error on console that no QueryClient provided. Help.
No description
3 Replies
gmasid
gmasid•4d ago
why put queryClient inside a useState? try to declare it outside of this context to prevent rerenders try like this and see if it works: src/lib/query-client.ts: import { QueryClient } from '@tanstack/react-query'; export const queryClient: QueryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, }, }, }); change the options as you need of course
Vishal
VishalOP•3d ago
Tried this too, same issue.
gmasid
gmasid•2d ago
weird, i have a chrome extension running fine with react query. can you send a link to repo so i can try to see where is wrong?

Did you find this page helpful?