File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export function SeamProvider({
8989 disabled = { disableTelemetry }
9090 endpoint = { endpoint }
9191 >
92- < SeamQueryProvider { ...props } >
92+ < SeamQueryProvider { ...props } queryClient = { globalThis . seamQueryClient ?? props . queryClient } >
9393 < Provider value = { value } >
9494 < Telemetry > { children } </ Telemetry >
9595 </ Provider >
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 useContext ,
1111 useEffect ,
1212 useMemo ,
13+ useState ,
1314} from 'react'
1415
1516import { useSeamClient } from './use-seam-client.js'
@@ -55,14 +56,13 @@ type SeamClientOptions = SeamHttpOptionsWithClientSessionToken
5556
5657export type SeamQueryProviderClientOptions = Pick < SeamClientOptions , 'endpoint' >
5758
58- const defaultQueryClient = new QueryClient ( )
59-
6059export function SeamQueryProvider ( {
6160 children,
6261 onSessionUpdate = ( ) => { } ,
6362 queryClient,
6463 ...props
6564} : SeamQueryProviderProps ) : JSX . Element {
65+ const [ defaultQueryClient ] = useState ( new QueryClient ( ) )
6666 const value = useMemo ( ( ) => {
6767 const context = createSeamQueryContextValue ( props )
6868 if (
@@ -88,9 +88,7 @@ export function SeamQueryProvider({
8888 const { Provider } = seamContext
8989
9090 return (
91- < QueryClientProvider
92- client = { queryClient ?? globalThis . seamQueryClient ?? defaultQueryClient }
93- >
91+ < QueryClientProvider client = { queryClient ?? defaultQueryClient } >
9492 < Provider value = { value } >
9593 < Session onSessionUpdate = { onSessionUpdate } > { children } </ Session >
9694 </ Provider >
You can’t perform that action at this time.
0 commit comments