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.

3 Replies
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
Tried this too, same issue.
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?