Skip to content

Commit

Permalink
fix: move the default query client
Browse files Browse the repository at this point in the history
  • Loading branch information
ugur-eren committed May 1, 2024
1 parent b7868d9 commit 1ab99de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-planets-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@starknet-react/core": patch
---

Move the default query client to outside of the Provider component
4 changes: 3 additions & 1 deletion packages/core/src/context/starknet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { ChainProviderFactory } from "~/providers";
import { ExplorerFactory } from "~/explorers/";
import { AccountProvider } from "./account";

const defaultQueryClient = new QueryClient();

/** State of the Starknet context. */
export interface StarknetState {
/** Connected connector. */
Expand Down Expand Up @@ -317,7 +319,7 @@ export function StarknetProvider({
});

return (
<QueryClientProvider client={queryClient ?? new QueryClient()}>
<QueryClientProvider client={queryClient ?? defaultQueryClient}>
<StarknetContext.Provider value={state}>
<AccountProvider account={account}>{children}</AccountProvider>
</StarknetContext.Provider>
Expand Down

0 comments on commit 1ab99de

Please sign in to comment.