I've a custom React hook which uses react-query useQuery() in it-self:
const useFetchSomething = () => {
const { data, isLoading } = useQuery('key', ....);
return .......
}
I had to create a custom hook then use the useQuery() hook inside it, because it has some features and gets data from react-query!
I tried to test this hook with react-hooks-testing-library:
const { result } = renderHook(() => useFetchSomething());
but I get this error:
Error: Uncaught [Error: No QueryClient set, use QueryClientProvider to set one]
for this, how can I wrap this part: renderHook(() => useFetchSomething()) with Provider?