We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
enabled
useWalletBalance
1 parent 1a71de0 commit c953c3fCopy full SHA for c953c3f
.changeset/yellow-numbers-yell.md
@@ -0,0 +1,5 @@
1
+---
2
+"thirdweb": patch
3
4
+
5
+Added `enabled` param to `useWalletBalance` hook
packages/thirdweb/src/react/core/hooks/others/useWalletBalance.ts
@@ -19,7 +19,7 @@ export type UseWalletBalanceOptions = Prettify<
19
>;
20
export type UseWalletBalanceQueryOptions = Omit<
21
UseQueryOptions<GetWalletBalanceResult>,
22
- "queryFn" | "queryKey" | "enabled"
+ "queryFn" | "queryKey"
23
24
25
/**
@@ -85,6 +85,10 @@ export function useWalletBalance(
85
tokenAddress,
86
});
87
},
88
- enabled: !!chain && !!client && !!address,
+ enabled:
89
+ (queryOptions?.enabled === undefined || queryOptions.enabled) &&
90
+ !!chain &&
91
+ !!client &&
92
+ !!address,
93
94
}
0 commit comments