Skip to content

Commit

Permalink
attempt to alleviate #12316
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Jan 29, 2025
1 parent c07621b commit 8854b26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react/hooks/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ function useObservableSubscriptionResult<
}
) {
const callbackRef = React.useRef<Callbacks<TData>>(callbacks);
React.useEffect(() => {
React.useLayoutEffect(() => {
// Make sure state.onCompleted and state.onError always reflect the latest
// options.onCompleted and options.onError callbacks provided to useQuery,
// since those functions are often recreated every time useQuery is called.
Expand Down

0 comments on commit 8854b26

Please sign in to comment.