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
12 changes: 6 additions & 6 deletions docs/framework/react/guides/advanced-ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The first step of any React Query setup is always to create a `queryClient` and

// Since QueryClientProvider relies on useContext under the hood, we have to put 'use client' on top
import {
isServer,
environmentManager,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
Expand All @@ -51,7 +51,7 @@ function makeQueryClient() {
let browserQueryClient: QueryClient | undefined = undefined

function getQueryClient() {
if (isServer) {
if (environmentManager.isServer()) {
// Server: always make a new query client
return makeQueryClient()
} else {
Expand Down Expand Up @@ -376,7 +376,7 @@ We will also need to move the `getQueryClient()` function out of our `app/provid
```tsx
// app/get-query-client.ts
import {
isServer,
environmentManager,
QueryClient,
defaultShouldDehydrateQuery,
} from '@tanstack/react-query'
Expand Down Expand Up @@ -408,7 +408,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 Expand Up @@ -564,7 +564,7 @@ To achieve this, wrap your app in the `ReactQueryStreamedHydration` component:
'use client'

import {
isServer,
environmentManager,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
Expand All @@ -586,7 +586,7 @@ function makeQueryClient() {
let browserQueryClient: QueryClient | undefined = undefined

function getQueryClient() {
if (isServer) {
if (environmentManager.isServer()) {
// Server: always make a new query client
return makeQueryClient()
} else {
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/guides/suspense.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ To achieve this, wrap your app in the `ReactQueryStreamedHydration` component:
'use client'

import {
isServer,
environmentManager,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
Expand All @@ -142,7 +142,7 @@ function makeQueryClient() {
let browserQueryClient: QueryClient | undefined = undefined

function getQueryClient() {
if (isServer) {
if (environmentManager.isServer()) {
// Server: always make a new query client
return makeQueryClient()
} else {
Expand Down
Loading