MCPcopy
hub / github.com/TanStack/query / setIsServer

Function setIsServer

packages/react-query/src/__tests__/utils.tsx:61–72  ·  view source on GitHub ↗
(isServer: boolean)

Source from the content-addressed store, hash-verified

59// This monkey-patches the isServer-value from utils,
60// so that we can pretend to be in a server environment
61export function setIsServer(isServer: boolean) {
62 const original = utils.isServer
63 Object.defineProperty(utils, 'isServer', {
64 get: () => isServer,
65 })
66
67 return () => {
68 Object.defineProperty(utils, 'isServer', {
69 get: () => original,
70 })
71 }
72}

Callers 2

ssr.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…