Skip to content

Commit 2faff25

Browse files
authored
fix(examples): replace deprecated 'isServer' with 'environmentManager.isServer()' in remaining Next.js examples (#10860)
1 parent 0bc0a88 commit 2faff25

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

examples/react/nextjs-app-prefetching/app/get-query-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
QueryClient,
33
defaultShouldDehydrateQuery,
4-
isServer,
4+
environmentManager,
55
} from '@tanstack/react-query'
66

77
function makeQueryClient() {
@@ -23,7 +23,7 @@ function makeQueryClient() {
2323
let browserQueryClient: QueryClient | undefined = undefined
2424

2525
export function getQueryClient() {
26-
if (isServer) {
26+
if (environmentManager.isServer()) {
2727
// Server: always make a new query client
2828
return makeQueryClient()
2929
} else {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import {
44
QueryClient,
55
QueryClientProvider,
6-
isServer,
6+
environmentManager,
77
} from '@tanstack/react-query'
88
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
99
import * as React from 'react'
@@ -22,7 +22,7 @@ function makeQueryClient() {
2222
let browserQueryClient: QueryClient | undefined = undefined
2323

2424
function getQueryClient() {
25-
if (isServer) {
25+
if (environmentManager.isServer()) {
2626
return makeQueryClient()
2727
} else {
2828
if (!browserQueryClient) browserQueryClient = makeQueryClient()

0 commit comments

Comments
 (0)