diff --git a/libs/sdk-js/src/react/stream.tsx b/libs/sdk-js/src/react/stream.tsx index 5493fae2f..8ac73ca9e 100644 --- a/libs/sdk-js/src/react/stream.tsx +++ b/libs/sdk-js/src/react/stream.tsx @@ -321,11 +321,10 @@ function useThreadHistory>( ) { const [history, setHistory] = useState[]>([]); + const clientHash = getClientConfigHash(client); const clientRef = useRef(client); clientRef.current = client; - const clientHash = getClientConfigHash(client); - const fetcher = useCallback( ( threadId: string | undefined | null, @@ -342,13 +341,13 @@ function useThreadHistory>( clearCallbackRef.current?.(); return Promise.resolve([]); }, - [clientHash], + [], ); useEffect(() => { if (submittingRef.current) return; fetcher(threadId); - }, [fetcher, submittingRef, threadId]); + }, [fetcher, clientHash, submittingRef, threadId]); return { data: history,