Skip to content

Commit

Permalink
fix(react-query): experimental before/after query options (#7651)
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley authored Jun 30, 2024
1 parent 3ee5bd8 commit 4be599f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react-query/src/useBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function useBaseQuery<
const errorResetBoundary = useQueryErrorResetBoundary()
const defaultedOptions = client.defaultQueryOptions(options)

;(client.getDefaultOptions() as any)._experimental_beforeQuery?.(
;(client.getDefaultOptions().queries as any)._experimental_beforeQuery?.(
defaultedOptions,
)

Expand Down Expand Up @@ -125,7 +125,10 @@ export function useBaseQuery<
throw result.error
}

;(client.getDefaultOptions() as any).afterQuery?.(defaultedOptions, result)
;(client.getDefaultOptions().queries as any)._experimental_afterQuery?.(
defaultedOptions,
result,
)

// Handle result property usage tracking
return !defaultedOptions.notifyOnChangeProps
Expand Down

0 comments on commit 4be599f

Please sign in to comment.