()
| 17 | } |
| 18 | let browserQueryClient: QueryClient | undefined = undefined; |
| 19 | function getQueryClient() { |
| 20 | if (typeof window === 'undefined') { |
| 21 | // Server: always make a new query client |
| 22 | return makeQueryClient(); |
| 23 | } else { |
| 24 | // Browser: make a new query client if we don't already have one |
| 25 | // This is very important, so we don't re-make a new client if React |
| 26 | // suspends during the initial render. This may not be needed if we |
| 27 | // have a suspense boundary BELOW the creation of the query client |
| 28 | if (!browserQueryClient) browserQueryClient = makeQueryClient(); |
| 29 | return browserQueryClient; |
| 30 | } |
| 31 | } |
| 32 | export default function App({ children }: { children: React.ReactNode }) { |
| 33 | const queryClient = getQueryClient(); |
| 34 | const [trpcClient] = useState(() => |
no test coverage detected