Skip to content
Source
Docs
Explore
Skills
MCP servers
For agents
Search or jump to…
Sign in
Sign up
TanStack
/
query
Pull requests
TanStack
query
Public
Synced with GitHub
Popular #10
Fork
0
0
0
0
1
2
3
4
5
6
7
8
9
Code
Architecture
Issues
Pull requests
Community
Assets
Artifacts
CI
Agents
Settings
fix(core): do not reject promise right away - only when `promise` gets used
#9576
Send to my agent
Merged
TkDodo
merged 4 commits into
main
from
refs/pull/9576/head
·
merged by
TkDodo
last year
View on GitHub
Conversation
12
Commits
4
Files changed
1
Impact
Showing
1 changed file
with
11 additions
and
5 deletions
.
x
0 of 1 viewed, 1 left
Files
Hide whitespace
Unified
Split
11 additions and 5 deletions
+11
-5
packages/query-core/src/queryObserver.ts
Modified
Diff
Before/After
Viewed
packages/query-core/src/queryObserver.ts
View file
Expand up
Show all 81 lines
@@ -82,11 +82,6 @@
82
82
this
.#client = client
83
83
this
.#selectError =
null
84
84
this
.#currentThenable =
pendingThenable
()
85
-
if
(!
this
.
options
.
experimental_prefetchInRender
) {
86
-
this
.#currentThenable.
reject
(
87
-
new
Error
(
'experimental_prefetchInRender feature flag is not enabled'
),
88
-
)
89
-
}
90
85
91
86
this
.
bindMethods
()
92
87
this
.
setOptions
(options)
Expand up
Expand down
Show all 179 lines
@@ -272,6 +267,17 @@
272
267
get
: (target, key) => {
273
268
this
.
trackProp
(key
as
keyof
QueryObserverResult
)
274
269
onPropTracked?.(key
as
keyof
QueryObserverResult
)
270
+
if
(
271
+
key ===
'promise'
&&
272
+
!
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
+
),
279
+
)
280
+
}
275
281
return
Reflect
.
get
(target, key)
276
282
},
Home
Search
Explore
Menu