Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move the default query client to outside of the component #437

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading