Skip to main content

useResetClaimConditions

Hook for resetting a claim condition on a NFTDropCollection contract.

import { useResetClaimConditions } from "@thirdweb-dev/react";

Usage

Provide your NFT collection contract as the argument.

import {
useResetClaimConditions,
useContract,
Web3Button,
} from "@thirdweb-dev/react";

// Your smart contract address
const contractAddress = "{{contract_address}}";

// The token ID of the NFT to reset the claim condition for
const tokenId = "{{token_id}}";

function App() {
const { contract } = useContract(contractAddress);
const {
mutateAsync: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(contract, tokenId);

if (error) {
console.error("failed to reset claim condition", error);
}

return (
<Web3Button
contractAddress={contractAddress}
action={() => resetClaimConditions()}
>
Reset Claim Condition
</Web3Button>
);
}

Configuration

tokenId

If provided, the action will only reset the claim condition for the specific token ID.

If not provided, the action will reset the claim condition for all tokens in the collection.

import {
useResetClaimConditions,
useContract,
Web3Button,
} from "@thirdweb-dev/react";

// Your smart contract address
const contractAddress = "{{contract_address}}";

// The token ID of the NFT to reset the claim condition for
const tokenId = "{{token_id}}";

function App() {
const { contract } = useContract(contractAddress);
const {
mutateAsync: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(contract, tokenId);

if (error) {
console.error("failed to reset claim condition", error);
}

return (
<Web3Button
contractAddress={contractAddress}
action={() =>
resetClaimConditions(tokenId)
}
>
Reset Claim Condition
</Web3Button>
);
}