Skip to content

Commit 5d316c4

Browse files
committed
fix: fix experimental before/after query options
1 parent 3ee5bd8 commit 5d316c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/react-query/src/useBaseQuery.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function useBaseQuery<
4949
const errorResetBoundary = useQueryErrorResetBoundary()
5050
const defaultedOptions = client.defaultQueryOptions(options)
5151

52-
;(client.getDefaultOptions() as any)._experimental_beforeQuery?.(
52+
;(client.getDefaultOptions().queries as any)._experimental_beforeQuery?.(
5353
defaultedOptions,
5454
)
5555

@@ -125,7 +125,10 @@ export function useBaseQuery<
125125
throw result.error
126126
}
127127

128-
;(client.getDefaultOptions() as any).afterQuery?.(defaultedOptions, result)
128+
;(client.getDefaultOptions().queries as any)._experimental_afterQuery?.(
129+
defaultedOptions,
130+
result,
131+
)
129132

130133
// Handle result property usage tracking
131134
return !defaultedOptions.notifyOnChangeProps

0 commit comments

Comments
 (0)