Skip to content

Commit 7088f6b

Browse files
committed
chore: add smol comment about lacking type inference of readContractsQueryOptions
1 parent 4d8b35f commit 7088f6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/curve-ui-kit/src/queries/token-balance.query.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export function useTokenBalance({ chainId, userAddress, tokenAddress }: FieldsOf
6060
query: { enabled: isEnabled && isNativeToken },
6161
})
6262

63+
// Spreading with ...readContractsQueryOptions() breaks Typescript's type inference, so we have to settle with the
64+
// least common denominator that does *not* cause type inference issues, which is getERC20QueryContracts.
6365
const erc20Balance = useReadContracts({
6466
allowFailure: false,
6567
contracts: isEnabled ? getERC20QueryContracts({ chainId, userAddress, tokenAddress }) : undefined,

0 commit comments

Comments
 (0)