From 9a43bcf8f3888e8d62f8842bb0bd9a950d7332ae Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Tue, 2 Jun 2026 09:57:23 +0900 Subject: [PATCH] fix(examples/integrations): replace deprecated 'isServer' with 'environmentManager.isServer()' in the Next.js examples --- examples/react/nextjs-suspense-streaming/src/app/page.tsx | 4 ++-- integrations/react-next-15/app/providers.tsx | 4 ++-- integrations/react-next-16/app/providers.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/react/nextjs-suspense-streaming/src/app/page.tsx b/examples/react/nextjs-suspense-streaming/src/app/page.tsx index 4c17668cbc3..c2d750b19a7 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 {