File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -82,11 +82,6 @@ export class QueryObserver<
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 )
@@ -272,6 +267,17 @@ export class QueryObserver<
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
} ,
277
283
} )
You can’t perform that action at this time.
0 commit comments