diff --git a/.changeset/early-pens-kick.md b/.changeset/early-pens-kick.md
new file mode 100644
index 00000000000..ecd27ea64f2
--- /dev/null
+++ b/.changeset/early-pens-kick.md
@@ -0,0 +1,5 @@
+---
+"@apollo/client": patch
+---
+
+Make `useRenderGuard` more resilient to changes in React internals.
diff --git a/.changeset/little-squids-watch.md b/.changeset/little-squids-watch.md
new file mode 100644
index 00000000000..2be90f20956
--- /dev/null
+++ b/.changeset/little-squids-watch.md
@@ -0,0 +1,5 @@
+---
+"@apollo/client": patch
+---
+
+Adds a fix for multipart subscriptions that terminate with payload: null
diff --git a/.github/workflows/snapshot-release.yml b/.github/workflows/snapshot-release.yml
index a255f285d78..cf496e33928 100644
--- a/.github/workflows/snapshot-release.yml
+++ b/.github/workflows/snapshot-release.yml
@@ -110,4 +110,8 @@ jobs:
with:
issue-number: ${{ github.event.issue.number }}
body: |
- A new release has been made for this PR. You can install it with `npm i @apollo/client@${{ steps.get-version.outputs.version }}`.
+ A new release has been made for this PR. You can install it with:
+
+ ```
+ npm i @apollo/client@${{ steps.get-version.outputs.version }}
+ ```
diff --git a/.size-limits.json b/.size-limits.json
index ba256af48d8..cdae2c9cd42 100644
--- a/.size-limits.json
+++ b/.size-limits.json
@@ -1,4 +1,4 @@
{
- "dist/apollo-client.min.cjs": 39211,
- "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32584
+ "dist/apollo-client.min.cjs": 39247,
+ "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32630
}
diff --git a/docs/source/performance/optimistic-ui.mdx b/docs/source/performance/optimistic-ui.mdx
index a6b15b48efd..b4c85efd82f 100644
--- a/docs/source/performance/optimistic-ui.mdx
+++ b/docs/source/performance/optimistic-ui.mdx
@@ -73,8 +73,12 @@ As this example shows, the value of `optimisticResponse` is an object that match
5. Apollo Client notifies all affected queries again. The associated components re-render, but if the server's response matches our `optimisticResponse`, this is invisible to the user.
+
+
## Bailing out of an optimistic update
+
+
In some cases you may want to skip an optimistic update. For example, you may want to perform an optimistic update _only_ when certain variables are passed to the mutation. To skip an update, pass a function to the `optimisticResponse` option and return the `IGNORE` sentinel object available on the second argument to bail out of the optimistic update.
Consider this example:
diff --git a/package-lock.json b/package-lock.json
index b2cfc6e9481..a0d0838f82b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -26,12 +26,12 @@
"zen-observable-ts": "^1.2.5"
},
"devDependencies": {
- "@arethetypeswrong/cli": "0.13.10",
- "@babel/parser": "7.23.9",
+ "@arethetypeswrong/cli": "0.15.1",
+ "@babel/parser": "7.24.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@graphql-tools/schema": "10.0.3",
- "@microsoft/api-extractor": "7.40.2",
+ "@microsoft/api-extractor": "7.42.3",
"@rollup/plugin-node-resolve": "11.2.1",
"@size-limit/esbuild-why": "11.0.2",
"@size-limit/preset-small-lib": "11.0.2",
@@ -46,27 +46,27 @@
"@types/hoist-non-react-statics": "3.3.5",
"@types/jest": "29.5.12",
"@types/lodash": "4.14.202",
- "@types/node": "20.11.24",
+ "@types/node": "20.11.25",
"@types/node-fetch": "2.6.11",
- "@types/react": "18.2.61",
- "@types/react-dom": "18.2.19",
+ "@types/react": "18.2.64",
+ "@types/react-dom": "18.2.21",
"@types/relay-runtime": "14.1.23",
"@types/use-sync-external-store": "0.0.6",
- "@typescript-eslint/eslint-plugin": "7.0.1",
- "@typescript-eslint/parser": "7.0.1",
- "@typescript-eslint/rule-tester": "7.0.1",
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/utils": "7.0.1",
+ "@typescript-eslint/eslint-plugin": "7.1.1",
+ "@typescript-eslint/parser": "7.1.1",
+ "@typescript-eslint/rule-tester": "7.1.1",
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/utils": "7.1.1",
"acorn": "8.11.3",
"blob-polyfill": "7.0.20220408",
"bytes": "3.1.2",
"cross-fetch": "4.0.0",
- "eslint": "8.56.0",
+ "eslint": "8.57.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c",
"eslint-plugin-local-rules": "2.0.1",
"eslint-plugin-testing-library": "6.2.0",
- "expect-type": "0.17.3",
+ "expect-type": "0.18.0",
"fetch-mock": "9.11.0",
"glob": "8.1.0",
"graphql": "16.8.1",
@@ -82,7 +82,7 @@
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@^17",
"react-error-boundary": "4.0.13",
- "recast": "0.23.5",
+ "recast": "0.23.6",
"resolve": "1.22.8",
"rimraf": "5.0.5",
"rollup": "2.79.1",
@@ -91,14 +91,14 @@
"rxjs": "7.8.1",
"size-limit": "11.0.2",
"subscriptions-transport-ws": "0.11.0",
- "terser": "5.27.1",
- "ts-api-utils": "1.2.1",
+ "terser": "5.29.1",
+ "ts-api-utils": "1.3.0",
"ts-jest": "29.1.2",
"ts-jest-resolver": "2.0.1",
"ts-morph": "21.0.1",
"ts-node": "10.9.2",
"typedoc": "0.25.0",
- "typescript": "5.3.3",
+ "typescript": "5.4.2",
"wait-for-observables": "1.0.3",
"web-streams-polyfill": "3.3.3",
"whatwg-fetch": "3.6.20"
@@ -163,12 +163,12 @@
"dev": true
},
"node_modules/@arethetypeswrong/cli": {
- "version": "0.13.10",
- "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.10.tgz",
- "integrity": "sha512-UV5Vk2ZaERQb0jS82rVWviKQieVpodiWKTOE/l8QN5fvG83AdhpI4QG8I5F1qSU/xq3K5RK44Bbgn6/JqwlT/A==",
+ "version": "0.15.1",
+ "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.15.1.tgz",
+ "integrity": "sha512-c4+MVbhktzLDnUFpvWvVkGRAb7zwd9b9ZW4eG62PkBsRRsTM6TKUNR23mLhz6tyYTalyqe8E6v09q4k0KuN3eQ==",
"dev": true,
"dependencies": {
- "@arethetypeswrong/core": "0.13.9",
+ "@arethetypeswrong/core": "0.15.1",
"chalk": "^4.1.2",
"cli-table3": "^0.6.3",
"commander": "^10.0.1",
@@ -220,9 +220,9 @@
}
},
"node_modules/@arethetypeswrong/core": {
- "version": "0.13.9",
- "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.9.tgz",
- "integrity": "sha512-JBvXC6fgHFWnTh0wrVsHbl+GPLdwD2IracDpHLvCLlnL4hx6fLCOdZL6Q4qdPAodcsehDL7M2fIrCMluk7kDeQ==",
+ "version": "0.15.1",
+ "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.15.1.tgz",
+ "integrity": "sha512-FYp6GBAgsNz81BkfItRz8RLZO03w5+BaeiPma1uCfmxTnxbtuMrI/dbzGiOk8VghO108uFI0oJo0OkewdSHw7g==",
"dev": true,
"dependencies": {
"@andrewbranch/untar.js": "^1.0.3",
@@ -251,6 +251,19 @@
"node": ">=10"
}
},
+ "node_modules/@arethetypeswrong/core/node_modules/typescript": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
+ "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
+ "dev": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
"node_modules/@babel/code-frame": {
"version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz",
@@ -589,9 +602,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.23.9",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
- "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
+ "version": "7.24.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz",
+ "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -1805,9 +1818,9 @@
}
},
"node_modules/@eslint/js": {
- "version": "8.56.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz",
- "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==",
+ "version": "8.57.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
+ "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1874,13 +1887,13 @@
}
},
"node_modules/@humanwhocodes/config-array": {
- "version": "0.11.13",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz",
- "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==",
+ "version": "0.11.14",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
+ "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
"dev": true,
"dependencies": {
- "@humanwhocodes/object-schema": "^2.0.1",
- "debug": "^4.1.1",
+ "@humanwhocodes/object-schema": "^2.0.2",
+ "debug": "^4.3.1",
"minimatch": "^3.0.5"
},
"engines": {
@@ -1901,9 +1914,9 @@
}
},
"node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz",
- "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz",
+ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==",
"dev": true
},
"node_modules/@isaacs/cliui": {
@@ -2518,19 +2531,20 @@
}
},
"node_modules/@microsoft/api-extractor": {
- "version": "7.40.2",
- "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.40.2.tgz",
- "integrity": "sha512-BCK+a9r0Nl/fd9fGhotaXJBt9IHBtuvEf/a8YS2UXwcqI4lnGcrvT3pAt3rrziS/dc5+0W/7TDZorULSj6N1Aw==",
+ "version": "7.42.3",
+ "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.42.3.tgz",
+ "integrity": "sha512-JNLJFpGHz6ekjS6bvYXxUBeRGnSHeCMFNvRbCQ+7XXB/ZFrgLSMPwWtEq40AiWAy+oyG5a4RSNwdJTp0B2USvQ==",
"dev": true,
"dependencies": {
- "@microsoft/api-extractor-model": "7.28.10",
+ "@microsoft/api-extractor-model": "7.28.13",
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
- "@rushstack/node-core-library": "3.66.1",
+ "@rushstack/node-core-library": "4.0.2",
"@rushstack/rig-package": "0.5.2",
- "@rushstack/ts-command-line": "4.17.2",
- "colors": "~1.2.1",
+ "@rushstack/terminal": "0.10.0",
+ "@rushstack/ts-command-line": "4.19.1",
"lodash": "~4.17.15",
+ "minimatch": "~3.0.3",
"resolve": "~1.22.1",
"semver": "~7.5.4",
"source-map": "~0.6.1",
@@ -2541,14 +2555,26 @@
}
},
"node_modules/@microsoft/api-extractor-model": {
- "version": "7.28.10",
- "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.10.tgz",
- "integrity": "sha512-5ThitnV04Jbo0337Q0/VOjeGdx0OiduGgx4aGzfD6gsTSppYCPQjm2eIygRfc7w+XIP33osAZsWHAOo419PGQg==",
+ "version": "7.28.13",
+ "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.13.tgz",
+ "integrity": "sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==",
"dev": true,
"dependencies": {
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "~0.16.1",
- "@rushstack/node-core-library": "3.66.1"
+ "@rushstack/node-core-library": "4.0.2"
+ }
+ },
+ "node_modules/@microsoft/api-extractor/node_modules/minimatch": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz",
+ "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
}
},
"node_modules/@microsoft/api-extractor/node_modules/semver": {
@@ -2566,6 +2592,19 @@
"node": ">=10"
}
},
+ "node_modules/@microsoft/api-extractor/node_modules/typescript": {
+ "version": "5.3.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
+ "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
+ "dev": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
"node_modules/@microsoft/tsdoc": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz",
@@ -2686,12 +2725,11 @@
"dev": true
},
"node_modules/@rushstack/node-core-library": {
- "version": "3.66.1",
- "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.66.1.tgz",
- "integrity": "sha512-ker69cVKAoar7MMtDFZC4CzcDxjwqIhFzqEnYI5NRN/8M3om6saWCVx/A7vL2t/jFCJsnzQplRDqA7c78pytng==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz",
+ "integrity": "sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==",
"dev": true,
"dependencies": {
- "colors": "~1.2.1",
"fs-extra": "~7.0.1",
"import-lazy": "~4.0.0",
"jju": "~1.4.0",
@@ -2733,15 +2771,48 @@
"strip-json-comments": "~3.1.1"
}
},
+ "node_modules/@rushstack/terminal": {
+ "version": "0.10.0",
+ "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.10.0.tgz",
+ "integrity": "sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==",
+ "dev": true,
+ "dependencies": {
+ "@rushstack/node-core-library": "4.0.2",
+ "supports-color": "~8.1.1"
+ },
+ "peerDependencies": {
+ "@types/node": "*"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@rushstack/terminal/node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
"node_modules/@rushstack/ts-command-line": {
- "version": "4.17.2",
- "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.17.2.tgz",
- "integrity": "sha512-QS2S2nJo9zXq/+9Dk10LmvIFugMizI9IeQUH4jnhIcoaeqYlsv2fK830U+/gMKpI5vomXz19XMXfkUfZzO4R3A==",
+ "version": "4.19.1",
+ "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.19.1.tgz",
+ "integrity": "sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==",
"dev": true,
"dependencies": {
+ "@rushstack/terminal": "0.10.0",
"@types/argparse": "1.0.38",
"argparse": "~1.0.9",
- "colors": "~1.2.1",
"string-argv": "~0.3.1"
}
},
@@ -3387,9 +3458,9 @@
"dev": true
},
"node_modules/@types/node": {
- "version": "20.11.24",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz",
- "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==",
+ "version": "20.11.25",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz",
+ "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@@ -3418,9 +3489,9 @@
"dev": true
},
"node_modules/@types/react": {
- "version": "18.2.61",
- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.61.tgz",
- "integrity": "sha512-NURTN0qNnJa7O/k4XUkEW2yfygA+NxS0V5h1+kp9jPwhzZy95q3ADoGMP0+JypMhrZBTTgjKAUlTctde1zzeQA==",
+ "version": "18.2.64",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.64.tgz",
+ "integrity": "sha512-MlmPvHgjj2p3vZaxbQgFUQFvD8QiZwACfGqEdDSWou5yISWxDQ4/74nCAwsUiX7UFLKZz3BbVSPj+YxeoGGCfg==",
"dev": true,
"dependencies": {
"@types/prop-types": "*",
@@ -3429,9 +3500,9 @@
}
},
"node_modules/@types/react-dom": {
- "version": "18.2.19",
- "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz",
- "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==",
+ "version": "18.2.21",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.21.tgz",
+ "integrity": "sha512-gnvBA/21SA4xxqNXEwNiVcP0xSGHh/gi1VhWv9Bl46a0ItbTT5nFY+G9VSQpaG/8N/qdJpJ+vftQ4zflTtnjLw==",
"dev": true,
"dependencies": {
"@types/react": "*"
@@ -3498,16 +3569,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz",
- "integrity": "sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz",
+ "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.5.1",
- "@typescript-eslint/scope-manager": "7.0.1",
- "@typescript-eslint/type-utils": "7.0.1",
- "@typescript-eslint/utils": "7.0.1",
- "@typescript-eslint/visitor-keys": "7.0.1",
+ "@typescript-eslint/scope-manager": "7.1.1",
+ "@typescript-eslint/type-utils": "7.1.1",
+ "@typescript-eslint/utils": "7.1.1",
+ "@typescript-eslint/visitor-keys": "7.1.1",
"debug": "^4.3.4",
"graphemer": "^1.4.0",
"ignore": "^5.2.4",
@@ -3548,15 +3619,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.1.tgz",
- "integrity": "sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz",
+ "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "7.0.1",
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/typescript-estree": "7.0.1",
- "@typescript-eslint/visitor-keys": "7.0.1",
+ "@typescript-eslint/scope-manager": "7.1.1",
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/typescript-estree": "7.1.1",
+ "@typescript-eslint/visitor-keys": "7.1.1",
"debug": "^4.3.4"
},
"engines": {
@@ -3576,13 +3647,13 @@
}
},
"node_modules/@typescript-eslint/rule-tester": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-7.0.1.tgz",
- "integrity": "sha512-s+SC5xKDfDIuUytjdaoe/AsotpqnNEc+oaUvtHKupLRXoWw8yJHfbgtNmsqKZJvMeGwGAEHuFoNpminl56nSGA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/rule-tester/-/rule-tester-7.1.1.tgz",
+ "integrity": "sha512-VdMINBCn1HA7ov18I9XRDKFOKZeJqmx7eqaq+COoaTMVNzzXf0ALbAaTMwg9Qz5sXsrhcEYN6nx84fu8C9J/HQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "7.0.1",
- "@typescript-eslint/utils": "7.0.1",
+ "@typescript-eslint/typescript-estree": "7.1.1",
+ "@typescript-eslint/utils": "7.1.1",
"ajv": "^6.10.0",
"lodash.merge": "4.6.2",
"semver": "^7.5.4"
@@ -3615,13 +3686,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.1.tgz",
- "integrity": "sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz",
+ "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/visitor-keys": "7.0.1"
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/visitor-keys": "7.1.1"
},
"engines": {
"node": "^16.0.0 || >=18.0.0"
@@ -3632,13 +3703,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.0.1.tgz",
- "integrity": "sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz",
+ "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "7.0.1",
- "@typescript-eslint/utils": "7.0.1",
+ "@typescript-eslint/typescript-estree": "7.1.1",
+ "@typescript-eslint/utils": "7.1.1",
"debug": "^4.3.4",
"ts-api-utils": "^1.0.1"
},
@@ -3659,9 +3730,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.1.tgz",
- "integrity": "sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz",
+ "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==",
"dev": true,
"engines": {
"node": "^16.0.0 || >=18.0.0"
@@ -3672,13 +3743,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz",
- "integrity": "sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz",
+ "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/visitor-keys": "7.0.1",
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/visitor-keys": "7.1.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -3739,17 +3810,17 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.1.tgz",
- "integrity": "sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz",
+ "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@types/json-schema": "^7.0.12",
"@types/semver": "^7.5.0",
- "@typescript-eslint/scope-manager": "7.0.1",
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/typescript-estree": "7.0.1",
+ "@typescript-eslint/scope-manager": "7.1.1",
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/typescript-estree": "7.1.1",
"semver": "^7.5.4"
},
"engines": {
@@ -3779,12 +3850,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz",
- "integrity": "sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz",
+ "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "7.0.1",
+ "@typescript-eslint/types": "7.1.1",
"eslint-visitor-keys": "^3.4.1"
},
"engines": {
@@ -4755,15 +4826,6 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
- "node_modules/colors": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz",
- "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==",
- "dev": true,
- "engines": {
- "node": ">=0.1.90"
- }
- },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
@@ -5602,16 +5664,16 @@
}
},
"node_modules/eslint": {
- "version": "8.56.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz",
- "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==",
+ "version": "8.57.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
+ "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.56.0",
- "@humanwhocodes/config-array": "^0.11.13",
+ "@eslint/js": "8.57.0",
+ "@humanwhocodes/config-array": "^0.11.14",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
"@ungap/structured-clone": "^1.2.0",
@@ -6281,9 +6343,9 @@
}
},
"node_modules/expect-type": {
- "version": "0.17.3",
- "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-0.17.3.tgz",
- "integrity": "sha512-K0ZdZJ97jiAtaOwhEHHz/f0N6Xbj5reRz5g6+5BO7+OvqQ7PMQz0/c8bFSJs1zPotNJL5HJaC6t6lGPEAtGyOw==",
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-0.18.0.tgz",
+ "integrity": "sha512-xjKoyyDLoia2h1WF+vwV8AmEpQ0drGW0InRgyywAHyOC+XSPYMxGoMXSwPjXs46D8FgLmp32sHMd1KrVingDuQ==",
"dev": true,
"engines": {
"node": ">=12.0.0"
@@ -10558,9 +10620,9 @@
}
},
"node_modules/recast": {
- "version": "0.23.5",
- "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.5.tgz",
- "integrity": "sha512-M67zIddJiwXdfPQRYKJ0qZO1SLdH1I0hYeb0wzxA+pNOvAZiQHulWzuk+fYsEWRQ8VfZrgjyucqsCOtCyM01/A==",
+ "version": "0.23.6",
+ "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.6.tgz",
+ "integrity": "sha512-9FHoNjX1yjuesMwuthAmPKabxYQdOgihFYmT5ebXfYGBcnqXZf3WOVz+5foEZ8Y83P4ZY6yQD5GMmtV+pgCCAQ==",
"dev": true,
"dependencies": {
"ast-types": "^0.16.1",
@@ -11705,9 +11767,9 @@
}
},
"node_modules/terser": {
- "version": "5.27.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.1.tgz",
- "integrity": "sha512-29wAr6UU/oQpnTw5HoadwjUZnFQXGdOfj0LjZ4sVxzqwHh/QVkvr7m8y9WoR4iN3FRitVduTc6KdjcW38Npsug==",
+ "version": "5.29.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.1.tgz",
+ "integrity": "sha512-lZQ/fyaIGxsbGxApKmoPTODIzELy3++mXhS5hOqaAWZjQtpq/hFHAc+rm29NND1rYRxRWKcjuARNwULNXa5RtQ==",
"dev": true,
"dependencies": {
"@jridgewell/source-map": "^0.3.3",
@@ -11850,9 +11912,9 @@
}
},
"node_modules/ts-api-utils": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz",
- "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
+ "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==",
"dev": true,
"engines": {
"node": ">=16"
@@ -12175,9 +12237,9 @@
}
},
"node_modules/typescript": {
- "version": "5.3.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
- "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
+ "version": "5.4.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
+ "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
diff --git a/package.json b/package.json
index 51782cecce8..dd0800e9363 100644
--- a/package.json
+++ b/package.json
@@ -107,12 +107,12 @@
"zen-observable-ts": "^1.2.5"
},
"devDependencies": {
- "@arethetypeswrong/cli": "0.13.10",
- "@babel/parser": "7.23.9",
+ "@arethetypeswrong/cli": "0.15.1",
+ "@babel/parser": "7.24.0",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@graphql-tools/schema": "10.0.3",
- "@microsoft/api-extractor": "7.40.2",
+ "@microsoft/api-extractor": "7.42.3",
"@rollup/plugin-node-resolve": "11.2.1",
"@size-limit/esbuild-why": "11.0.2",
"@size-limit/preset-small-lib": "11.0.2",
@@ -127,27 +127,27 @@
"@types/hoist-non-react-statics": "3.3.5",
"@types/jest": "29.5.12",
"@types/lodash": "4.14.202",
- "@types/node": "20.11.24",
+ "@types/node": "20.11.25",
"@types/node-fetch": "2.6.11",
- "@types/react": "18.2.61",
- "@types/react-dom": "18.2.19",
+ "@types/react": "18.2.64",
+ "@types/react-dom": "18.2.21",
"@types/relay-runtime": "14.1.23",
"@types/use-sync-external-store": "0.0.6",
- "@typescript-eslint/eslint-plugin": "7.0.1",
- "@typescript-eslint/parser": "7.0.1",
- "@typescript-eslint/rule-tester": "7.0.1",
- "@typescript-eslint/types": "7.0.1",
- "@typescript-eslint/utils": "7.0.1",
+ "@typescript-eslint/eslint-plugin": "7.1.1",
+ "@typescript-eslint/parser": "7.1.1",
+ "@typescript-eslint/rule-tester": "7.1.1",
+ "@typescript-eslint/types": "7.1.1",
+ "@typescript-eslint/utils": "7.1.1",
"acorn": "8.11.3",
"blob-polyfill": "7.0.20220408",
"bytes": "3.1.2",
"cross-fetch": "4.0.0",
- "eslint": "8.56.0",
+ "eslint": "8.57.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "npm:@phryneas/eslint-plugin-import@2.27.5-pr.2813.2817.199971c",
"eslint-plugin-local-rules": "2.0.1",
"eslint-plugin-testing-library": "6.2.0",
- "expect-type": "0.17.3",
+ "expect-type": "0.18.0",
"fetch-mock": "9.11.0",
"glob": "8.1.0",
"graphql": "16.8.1",
@@ -163,7 +163,7 @@
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@^17",
"react-error-boundary": "4.0.13",
- "recast": "0.23.5",
+ "recast": "0.23.6",
"resolve": "1.22.8",
"rimraf": "5.0.5",
"rollup": "2.79.1",
@@ -172,14 +172,14 @@
"rxjs": "7.8.1",
"size-limit": "11.0.2",
"subscriptions-transport-ws": "0.11.0",
- "terser": "5.27.1",
- "ts-api-utils": "1.2.1",
+ "terser": "5.29.1",
+ "ts-api-utils": "1.3.0",
"ts-jest": "29.1.2",
"ts-jest-resolver": "2.0.1",
"ts-morph": "21.0.1",
"ts-node": "10.9.2",
"typedoc": "0.25.0",
- "typescript": "5.3.3",
+ "typescript": "5.4.2",
"wait-for-observables": "1.0.3",
"web-streams-polyfill": "3.3.3",
"whatwg-fetch": "3.6.20"
diff --git a/src/link/http/__tests__/HttpLink.ts b/src/link/http/__tests__/HttpLink.ts
index 31713defc3a..2ed657bc303 100644
--- a/src/link/http/__tests__/HttpLink.ts
+++ b/src/link/http/__tests__/HttpLink.ts
@@ -1940,6 +1940,10 @@ describe("HttpLink", () => {
"Content-Type: application/json",
"",
'{"payload":{"data":{"aNewDieWasCreated":{"die":{"color":"blue","roll":2,"sides":5}}}}}',
+ "---",
+ "Content-Type: application/json",
+ "",
+ '{"payload": null}',
"-----",
].join("\r\n");
diff --git a/src/link/http/parseAndCheckHttpResponse.ts b/src/link/http/parseAndCheckHttpResponse.ts
index 2b68d999cfd..32ed53d80ef 100644
--- a/src/link/http/parseAndCheckHttpResponse.ts
+++ b/src/link/http/parseAndCheckHttpResponse.ts
@@ -84,6 +84,9 @@ export async function readMultipartBody<
if (isApolloPayloadResult(result)) {
let next = {};
if ("payload" in result) {
+ if (Object.keys(result).length === 1 && result.payload === null) {
+ return;
+ }
next = { ...result.payload };
}
if ("errors" in result) {
diff --git a/src/react/hooks/internal/__tests__/useRenderGuard.test.tsx b/src/react/hooks/internal/__tests__/useRenderGuard.test.tsx
new file mode 100644
index 00000000000..a8cf0f0a69a
--- /dev/null
+++ b/src/react/hooks/internal/__tests__/useRenderGuard.test.tsx
@@ -0,0 +1,76 @@
+/* eslint-disable testing-library/render-result-naming-convention */
+import React, { useEffect } from "react";
+import { useRenderGuard } from "../useRenderGuard";
+import { render, waitFor } from "@testing-library/react";
+import { withCleanup } from "../../../../testing/internal";
+
+const UNDEF = {};
+
+it("returns a function that returns `true` if called during render", () => {
+ let result: boolean | typeof UNDEF = UNDEF;
+ function TestComponent() {
+ const calledDuringRender = useRenderGuard();
+ result = calledDuringRender();
+ return <>Test>;
+ }
+ render();
+ expect(result).toBe(true);
+});
+
+it("returns a function that returns `false` if called after render", async () => {
+ let result: boolean | typeof UNDEF = UNDEF;
+ function TestComponent() {
+ const calledDuringRender = useRenderGuard();
+ useEffect(() => {
+ result = calledDuringRender();
+ });
+ return <>Test>;
+ }
+ render();
+ await waitFor(() => {
+ expect(result).not.toBe(UNDEF);
+ });
+ expect(result).toBe(false);
+});
+
+function breakReactInternalsTemporarily() {
+ const R = React as unknown as {
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: any;
+ };
+ const orig = R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
+
+ R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {};
+ return withCleanup({}, () => {
+ R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = orig;
+ });
+}
+
+it("results in false negatives if React internals change", () => {
+ let result: boolean | typeof UNDEF = UNDEF;
+ function TestComponent() {
+ using _ = breakReactInternalsTemporarily();
+ const calledDuringRender = useRenderGuard();
+ result = calledDuringRender();
+ return <>Test>;
+ }
+ render();
+ expect(result).toBe(false);
+});
+
+it("does not result in false positives if React internals change", async () => {
+ let result: boolean | typeof UNDEF = UNDEF;
+ function TestComponent() {
+ using _ = breakReactInternalsTemporarily();
+ const calledDuringRender = useRenderGuard();
+ useEffect(() => {
+ using _ = breakReactInternalsTemporarily();
+ result = calledDuringRender();
+ });
+ return <>Test>;
+ }
+ render();
+ await waitFor(() => {
+ expect(result).not.toBe(UNDEF);
+ });
+ expect(result).toBe(false);
+});
diff --git a/src/react/hooks/internal/useRenderGuard.ts b/src/react/hooks/internal/useRenderGuard.ts
index 98bb21a8ef1..fbe341d56a9 100644
--- a/src/react/hooks/internal/useRenderGuard.ts
+++ b/src/react/hooks/internal/useRenderGuard.ts
@@ -16,7 +16,7 @@ export function useRenderGuard() {
return React.useCallback(() => {
return (
- RenderDispatcher !== null && RenderDispatcher === getRenderDispatcher()
+ RenderDispatcher != null && RenderDispatcher === getRenderDispatcher()
);
}, []);
}