We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccfe95b commit 4a51a54Copy full SHA for 4a51a54
1 file changed
packages/query-core/src/queryObserver.ts
@@ -267,9 +267,12 @@ export class QueryObserver<
267
get: (target, key) => {
268
this.trackProp(key as keyof QueryObserverResult)
269
onPropTracked?.(key as keyof QueryObserverResult)
270
- if (key === 'promise' && !this.options.experimental_prefetchInRender) {
271
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
272
- ;(this.#currentThenable as PendingThenable<TData>).reject?.(
+ if (
+ key === 'promise' &&
+ !this.options.experimental_prefetchInRender &&
273
+ this.#currentThenable.status === 'pending'
274
+ ) {
275
+ this.#currentThenable.reject(
276
new Error(
277
'experimental_prefetchInRender feature flag is not enabled',
278
),
0 commit comments