Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/react/nextjs-app-prefetching/app/get-query-client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
QueryClient,
defaultShouldDehydrateQuery,
isServer,
environmentManager,
} from '@tanstack/react-query'

function makeQueryClient() {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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()
Expand Down