File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-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,15 @@ export class QueryObserver<
272267 get : ( target , key ) => {
273268 this . trackProp ( key as keyof QueryObserverResult )
274269 onPropTracked ?.( key as keyof QueryObserverResult )
270+ console . log ( 'tracking prop' , key )
271+ if ( key === 'promise' && ! this . options . experimental_prefetchInRender ) {
272+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
273+ ; ( this . #currentThenable as PendingThenable < TData > ) . reject ?.(
274+ new Error (
275+ 'experimental_prefetchInRender feature flag is not enabled' ,
276+ ) ,
277+ )
278+ }
275279 return Reflect . get ( target , key )
276280 } ,
277281 } )
You can’t perform that action at this time.
0 commit comments