@tanstack/react-query 5.104.3 → 5.104.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ let _tanstack_query_core = require("@tanstack/query-core");
14
14
  * @param query - The query, used to evaluate a `throwOnError` function against its error.
15
15
  */
16
16
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
17
- const throwOnError = (query === null || query === void 0 ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? (0, _tanstack_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError;
17
+ const throwOnError = (query === null || query === void 0 ? void 0 : query.state.status) === "error" && typeof options.throwOnError === "function" ? (0, _tanstack_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError;
18
18
  if (options.suspense || throwOnError) {
19
19
  if (!errorResetBoundary.isReset()) options.retryOnMount = false;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.cjs","names":["shouldThrowError"],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,gBAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IACJ,MAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,cAAA,GAClDA,qBAAAA,iBAAAA,CAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,MAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
1
+ {"version":3,"file":"errorBoundaryUtils.cjs","names":["shouldThrowError"],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.status === 'error' &&\n typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [\n query.state.error as TError,\n query,\n ])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,gBAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IACJ,MAAO,MAAM,YAAW,WACxB,OAAO,QAAQ,iBAAiB,cAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,QAAQ,cAAc,CACrC,MAAM,MAAM,OACZ,KACF,CAAC,IACD,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,MAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.d.cts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAoBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
1
+ {"version":3,"file":"errorBoundaryUtils.d.cts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAwBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.d.ts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAoBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
1
+ {"version":3,"file":"errorBoundaryUtils.d.ts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAwBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
@@ -11,7 +11,7 @@ import { shouldThrowError } from "@tanstack/query-core";
11
11
  * @param query - The query, used to evaluate a `throwOnError` function against its error.
12
12
  */
13
13
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
14
- const throwOnError = (query === null || query === void 0 ? void 0 : query.state.error) && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
14
+ const throwOnError = (query === null || query === void 0 ? void 0 : query.state.status) === "error" && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
15
15
  if (options.suspense || throwOnError) {
16
16
  if (!errorResetBoundary.isReset()) options.retryOnMount = false;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.js","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,gBAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IACJ,MAAO,MAAM,UAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,KAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
1
+ {"version":3,"file":"errorBoundaryUtils.js","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.status === 'error' &&\n typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [\n query.state.error as TError,\n query,\n ])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,gBAAA,UAAA,QAAA,UAAA,KAAA,IAAA,KAAA,IACJ,MAAO,MAAM,YAAW,WACxB,OAAO,QAAQ,iBAAiB,aAC5B,iBAAiB,QAAQ,cAAc,CACrC,MAAM,MAAM,OACZ,KACF,CAAC,IACD,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,KAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
@@ -14,7 +14,7 @@ let _tanstack_query_core = require("@tanstack/query-core");
14
14
  * @param query - The query, used to evaluate a `throwOnError` function against its error.
15
15
  */
16
16
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
17
- const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? (0, _tanstack_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError;
17
+ const throwOnError = query?.state.status === "error" && typeof options.throwOnError === "function" ? (0, _tanstack_query_core.shouldThrowError)(options.throwOnError, [query.state.error, query]) : options.throwOnError;
18
18
  if (options.suspense || throwOnError) {
19
19
  if (!errorResetBoundary.isReset()) options.retryOnMount = false;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.cjs","names":["shouldThrowError"],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,cAAA,GAClDA,qBAAAA,iBAAAA,CAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,MAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
1
+ {"version":3,"file":"errorBoundaryUtils.cjs","names":["shouldThrowError"],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.status === 'error' &&\n typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [\n query.state.error as TError,\n query,\n ])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,eACJ,OAAO,MAAM,WAAW,WACxB,OAAO,QAAQ,iBAAiB,cAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,QAAQ,cAAc,CACrC,MAAM,MAAM,OACZ,KACF,CAAC,IACD,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,MAAA,GAC5BA,qBAAAA,iBAAAA,CAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.d.cts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAoBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
1
+ {"version":3,"file":"errorBoundaryUtils.d.cts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAwBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.d.ts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAoBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
1
+ {"version":3,"file":"errorBoundaryUtils.d.ts","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"mappings":";;;;;;;;;;;qBAoBa,kCACX,cACA,QACA,OACA,YACA,kBAAkB,UAElB,SAAS,8BACP,cACA,QACA,OACA,YACA,YAEF,oBAAoB,8BACpB,OAAO,MAAM,cAAc,QAAQ,YAAY;;;;;;qBAwBpC,6BACX,oBAAoB;;;;;;;;;qBAeT,cACX,OACA,QACA,cACA,YACA,kBAAkB,YAClB,QAAA,oBAAA,cAAA,OAAA;EAOA,QAAQ,oBAAoB,OAAO;EACnC,oBAAoB;EACpB,cAAc,aAAa,cAAc,QAAQ,YAAY;EAC7D,OAAO,MAAM,cAAc,QAAQ,YAAY;EAC/C"}
@@ -11,7 +11,7 @@ import { shouldThrowError } from "@tanstack/query-core";
11
11
  * @param query - The query, used to evaluate a `throwOnError` function against its error.
12
12
  */
13
13
  const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
14
- const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
14
+ const throwOnError = query?.state.status === "error" && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
15
15
  if (options.suspense || throwOnError) {
16
16
  if (!errorResetBoundary.isReset()) options.retryOnMount = false;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorBoundaryUtils.js","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,eACJ,OAAO,MAAM,SAAS,OAAO,QAAQ,iBAAiB,aAClD,iBAAiB,QAAQ,cAAc,CAAC,MAAM,MAAM,OAAO,KAAK,CAAC,IACjE,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,KAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
1
+ {"version":3,"file":"errorBoundaryUtils.js","names":[],"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\n/**\n * Turns off `retryOnMount` for a query that throws its errors (with `suspense` or `throwOnError`),\n * unless the error boundary has been reset, so a remount doesn't retry the failed query before the\n * user resets the boundary. Mutates the options.\n * @param options - The defaulted query options to adjust.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n * @param query - The query, used to evaluate a `throwOnError` function against its error.\n */\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,\n) => {\n const throwOnError =\n query?.state.status === 'error' &&\n typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [\n query.state.error as TError,\n query,\n ])\n : options.throwOnError\n\n if (options.suspense || throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\n/**\n * Clears the reset state of the error boundary after the component mounts, so later errors are\n * thrown to the boundary again.\n * @param errorResetBoundary - The value of the nearest `QueryErrorResetBoundary`.\n */\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\n/**\n * Checks whether the query error should be thrown to the nearest error boundary: the query errored\n * and isn't fetching, the boundary hasn't been reset, and either `suspense` is enabled with no data\n * or `throwOnError` says so.\n * @param params - The observer `result`, the `errorResetBoundary`, the `throwOnError` option, the\n * `query`, and the `suspense` option.\n * @returns `true` if the error should be thrown.\n */\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,mCAOX,SAOA,oBACA,UACG;CACH,MAAM,eACJ,OAAO,MAAM,WAAW,WACxB,OAAO,QAAQ,iBAAiB,aAC5B,iBAAiB,QAAQ,cAAc,CACrC,MAAM,MAAM,OACZ,KACF,CAAC,IACD,QAAQ;CAEd,IAAI,QAAQ,YAAY,cAElB;MAAA,CAAC,mBAAmB,QAAQ,GAC9B,QAAQ,eAAe;CAAA;AAG7B;;;;;;AAOA,MAAa,8BACX,uBACG;CACH,MAAM,gBAAgB;EACpB,mBAAmB,WAAW;CAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;;;;;;;;;AAUA,MAAa,eAMX,EACA,QACA,oBACA,cACA,OACA,eAOI;CACJ,OACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,UACE,YAAY,OAAO,SAAS,KAAA,KAC5B,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAE1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query",
3
- "version": "5.104.3",
3
+ "version": "5.104.4",
4
4
  "description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -44,11 +44,11 @@
44
44
  "!build/codemods/**/__tests__"
45
45
  ],
46
46
  "dependencies": {
47
- "@tanstack/query-core": "5.104.3"
47
+ "@tanstack/query-core": "5.104.4"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@eslint-react/eslint-plugin": "^5.23.3",
51
- "@tanstack/query-persist-client-core": "5.104.3",
51
+ "@tanstack/query-persist-client-core": "5.104.4",
52
52
  "@tanstack/query-test-utils": "0.0.0",
53
53
  "@testing-library/react": "^16.1.0",
54
54
  "@testing-library/react-render-stream": "^2.0.2",
@@ -62,8 +62,14 @@
62
62
  "typescript": "6.0.3"
63
63
  },
64
64
  "peerDependencies": {
65
+ "@types/react": "^18 || ^19",
65
66
  "react": "^18 || ^19"
66
67
  },
68
+ "peerDependenciesMeta": {
69
+ "@types/react": {
70
+ "optional": true
71
+ }
72
+ },
67
73
  "scripts": {
68
74
  "clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
69
75
  "compile": "tsc --project tsconfig.json",
@@ -36,8 +36,12 @@ export const ensurePreventErrorBoundaryRetry = <
36
36
  query: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,
37
37
  ) => {
38
38
  const throwOnError =
39
- query?.state.error && typeof options.throwOnError === 'function'
40
- ? shouldThrowError(options.throwOnError, [query.state.error, query])
39
+ query?.state.status === 'error' &&
40
+ typeof options.throwOnError === 'function'
41
+ ? shouldThrowError(options.throwOnError, [
42
+ query.state.error as TError,
43
+ query,
44
+ ])
41
45
  : options.throwOnError
42
46
 
43
47
  if (options.suspense || throwOnError) {