MCPcopy Create free account
hub / github.com/TanStack/query / useQueryClient

Function useQueryClient

packages/solid-query/src/QueryClientProvider.tsx:28–39  ·  view source on GitHub ↗
(queryClient?: QueryClient)

Source from the content-addressed store, hash-verified

26 * component tree.
27 */
28export const useQueryClient = (queryClient?: QueryClient) => {
29 if (queryClient) {
30 return queryClient
31 }
32 const client = useContext(QueryClientContext)
33
34 if (!client) {
35 throw new Error(queryClientContextError)
36 }
37
38 return client()
39}
40
41/**
42 * Resolves the `QueryClient` to use: the given one, or else the one from the nearest

Callers 15

SolidQueryDevtoolsFunction · 0.90
SolidQueryDevtoolsPanelFunction · 0.90
CharacterItemFunction · 0.90
ExampleFunction · 0.90
ProjectsFunction · 0.90
NewFunction · 0.90
EditFunction · 0.90
ContactPageFunction · 0.90
FavoriteFunction · 0.90
prefetch.tsxFile · 0.90
TodoListUIFunction · 0.90
TodoListCacheFunction · 0.90

Calls 1

clientFunction · 0.85

Tested by 1

PageFunction · 0.40