()
| 103 | * mounted and the default is ambiguous. |
| 104 | */ |
| 105 | export function useQueryClient(): QueryClient { |
| 106 | const client = getDefaultQueryClient() |
| 107 | if (client) { |
| 108 | return client |
| 109 | } |
| 110 | |
| 111 | if (registeredClients.size > 1) { |
| 112 | throw createAmbiguousQueryClientError() |
| 113 | } |
| 114 | |
| 115 | throw createMissingQueryClientError() |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Resolves an explicit `QueryClient` or falls back to `useQueryClient`. |
no test coverage detected