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<
8282 this . #client = client
8383 this . #selectError = null
8484 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- }
9085
9186 this . bindMethods ( )
9287 this . setOptions ( options )
@@ -272,6 +267,17 @@ export class QueryObserver<
272267 get : ( target , key ) => {
273268 this . trackProp ( key as keyof QueryObserverResult )
274269 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+ }
275281 return Reflect . get ( target , key )
276282 } ,
277283 } )
You can’t perform that action at this time.
0 commit comments