diff --git a/examples/react/nextjs-suspense-streaming/src/app/page.tsx b/examples/react/nextjs-suspense-streaming/src/app/page.tsx index 67eedee7b9f..66023daa723 100644 --- a/examples/react/nextjs-suspense-streaming/src/app/page.tsx +++ b/examples/react/nextjs-suspense-streaming/src/app/page.tsx @@ -1,11 +1,11 @@ 'use client' -import { isServer, useSuspenseQuery } from '@tanstack/react-query' +import { environmentManager, useSuspenseQuery } from '@tanstack/react-query' import { Suspense } from 'react' export const runtime = 'edge' // 'nodejs' (default) | 'edge' function getBaseURL() { - if (!isServer) { + if (!environmentManager.isServer()) { return '' } if (process.env.VERCEL_URL) { diff --git a/integrations/react-next-15/app/providers.tsx b/integrations/react-next-15/app/providers.tsx index aa52fc1d35c..3ca21b143ef 100644 --- a/integrations/react-next-15/app/providers.tsx +++ b/integrations/react-next-15/app/providers.tsx @@ -2,7 +2,7 @@ 'use client' // Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top -import { QueryClientProvider, isServer } from '@tanstack/react-query' +import { QueryClientProvider, environmentManager } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import type { QueryClient } from '@tanstack/react-query' import { makeQueryClient } from '@/app/make-query-client' @@ -10,7 +10,7 @@ import { makeQueryClient } from '@/app/make-query-client' let browserQueryClient: QueryClient | undefined = undefined function getQueryClient() { - if (isServer) { + if (environmentManager.isServer()) { // Server: always make a new query client return makeQueryClient() } else { diff --git a/integrations/react-next-16/app/providers.tsx b/integrations/react-next-16/app/providers.tsx index aa52fc1d35c..3ca21b143ef 100644 --- a/integrations/react-next-16/app/providers.tsx +++ b/integrations/react-next-16/app/providers.tsx @@ -2,7 +2,7 @@ 'use client' // Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top -import { QueryClientProvider, isServer } from '@tanstack/react-query' +import { QueryClientProvider, environmentManager } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import type { QueryClient } from '@tanstack/react-query' import { makeQueryClient } from '@/app/make-query-client' @@ -10,7 +10,7 @@ import { makeQueryClient } from '@/app/make-query-client' let browserQueryClient: QueryClient | undefined = undefined function getQueryClient() { - if (isServer) { + if (environmentManager.isServer()) { // Server: always make a new query client return makeQueryClient() } else {