Skip to content

Commit 0bc0a88

Browse files
authored
fix(examples/integrations): replace deprecated 'isServer' with 'environmentManager.isServer()' in the Next.js examples (#10858)
1 parent f167fa8 commit 0bc0a88

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/react/nextjs-suspense-streaming/src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use client'
2-
import { isServer, useSuspenseQuery } from '@tanstack/react-query'
2+
import { environmentManager, useSuspenseQuery } from '@tanstack/react-query'
33
import { Suspense } from 'react'
44

55
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
66

77
function getBaseURL() {
8-
if (!isServer) {
8+
if (!environmentManager.isServer()) {
99
return ''
1010
}
1111
if (process.env.VERCEL_URL) {

integrations/react-next-15/app/providers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
'use client'
33

44
// Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top
5-
import { QueryClientProvider, isServer } from '@tanstack/react-query'
5+
import { QueryClientProvider, environmentManager } from '@tanstack/react-query'
66
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
77
import type { QueryClient } from '@tanstack/react-query'
88
import { makeQueryClient } from '@/app/make-query-client'
99

1010
let browserQueryClient: QueryClient | undefined = undefined
1111

1212
function getQueryClient() {
13-
if (isServer) {
13+
if (environmentManager.isServer()) {
1414
// Server: always make a new query client
1515
return makeQueryClient()
1616
} else {

integrations/react-next-16/app/providers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
'use client'
33

44
// Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top
5-
import { QueryClientProvider, isServer } from '@tanstack/react-query'
5+
import { QueryClientProvider, environmentManager } from '@tanstack/react-query'
66
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
77
import type { QueryClient } from '@tanstack/react-query'
88
import { makeQueryClient } from '@/app/make-query-client'
99

1010
let browserQueryClient: QueryClient | undefined = undefined
1111

1212
function getQueryClient() {
13-
if (isServer) {
13+
if (environmentManager.isServer()) {
1414
// Server: always make a new query client
1515
return makeQueryClient()
1616
} else {

0 commit comments

Comments
 (0)