Skip to content

Commit

Permalink
fix(react-query): no ref in useHookResult() (#5433)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Feb 3, 2024
1 parent 0d93bc9 commit 3bdb43b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/react-query/src/internals/useHookResult.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useRef } from 'react';
import { useMemo } from 'react';

export interface TRPCHookResult {
trpc: {
Expand All @@ -12,7 +12,6 @@ export interface TRPCHookResult {
export function useHookResult(
value: TRPCHookResult['trpc'],
): TRPCHookResult['trpc'] {
const ref = useRef(value);
ref.current.path = value.path;
return ref.current;
const { path } = value;
return useMemo(() => ({ path }), [path]);
}

0 comments on commit 3bdb43b

Please sign in to comment.