Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
7 changes: 7 additions & 0 deletions .changeset/ten-jokes-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@thirdweb-dev/react-core": patch
---

Fix return type of `useUnclaimedNFTs` hook.

This fixes https://github.com/thirdweb-dev/js/issues/2110
8 changes: 5 additions & 3 deletions packages/react-core/src/evm/hooks/async/drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
UseQueryResult,
} from "@tanstack/react-query";
import type {
NFT,
NFTMetadata,
NFTMetadataInput,
QueryAllParams,
UploadProgressEvent,
Expand Down Expand Up @@ -87,7 +87,7 @@ import invariant from "tiny-invariant";
export function useUnclaimedNFTs(
contract: RequiredParam<NFTDrop>,
queryParams?: QueryAllParams,
): UseQueryResult<NFT[]> {
): UseQueryResult<NFTMetadata[]> {
const contractAddress = contract?.getAddress();
return useQueryWithNetwork(
cacheKeys.contract.nft.drop.getAllUnclaimed(contractAddress, queryParams),
Expand All @@ -98,7 +98,9 @@ export function useUnclaimedNFTs(
contract.getAllUnclaimed,
"Contract instance does not support getAllUnclaimed",
);
return contract.getAllUnclaimed(queryParams);
const data: Promise<NFTMetadata[]> =
contract.getAllUnclaimed(queryParams);
return data;
},
{ enabled: !!contract },
);
Expand Down