diff --git a/examples/react/nextjs-app-prefetching/app/get-query-client.ts b/examples/react/nextjs-app-prefetching/app/get-query-client.ts index 9ca1cc407e4..61f9b457ded 100644 --- a/examples/react/nextjs-app-prefetching/app/get-query-client.ts +++ b/examples/react/nextjs-app-prefetching/app/get-query-client.ts @@ -1,7 +1,7 @@ import { QueryClient, defaultShouldDehydrateQuery, - isServer, + environmentManager, } from '@tanstack/react-query' function makeQueryClient() { @@ -23,7 +23,7 @@ function makeQueryClient() { let browserQueryClient: QueryClient | undefined = undefined export function getQueryClient() { - if (isServer) { + if (environmentManager.isServer()) { // Server: always make a new query client return makeQueryClient() } else { diff --git a/examples/react/nextjs-suspense-streaming/src/app/providers.tsx b/examples/react/nextjs-suspense-streaming/src/app/providers.tsx index b4990842e54..85615abb2d9 100644 --- a/examples/react/nextjs-suspense-streaming/src/app/providers.tsx +++ b/examples/react/nextjs-suspense-streaming/src/app/providers.tsx @@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider, - isServer, + environmentManager, } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import * as React from 'react' @@ -22,7 +22,7 @@ function makeQueryClient() { let browserQueryClient: QueryClient | undefined = undefined function getQueryClient() { - if (isServer) { + if (environmentManager.isServer()) { return makeQueryClient() } else { if (!browserQueryClient) browserQueryClient = makeQueryClient()