useResetClaimConditions
Hook for resetting the claim conditions on a drop contract.
Available to use on contracts that implement ERC721ClaimableWithConditions, ERC1155ClaimableWithConditions, or ERC20ClaimableWithConditions.
import { useResetClaimConditions } from "@thirdweb-dev/react";
const { mutateAsync, isLoading, error } = useResetClaimConditions(contract);
Usage
Provide your drop contract from the useContract
hook as an argument to the hook.
import {
useContract,
useResetClaimConditions,
Web3Button,
} from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
function App() {
// Contract must be a drop contract that implements claim conditions
const { contract } = useContract(contractAddress);
const {
mutateAsync: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(contract);
return (
<Web3Button
contractAddress={contractAddress}
action={() => resetClaimConditions()}
>
Reset Claim Conditions
</Web3Button>
);
}
Configuration
tokenId (ERC1155 only)
For ERC1155 NFTs, provide the token ID of the NFT as the second argument to the hook.
import {
useContract,
useResetClaimConditions,
Web3Button,
} from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const tokenId = "{{token_id}}";
function App() {
// Contract must be a drop contract that implements claim conditions
const { contract } = useContract(contractAddress);
const {
mutateAsync: resetClaimConditions,
isLoading,
error,
} = useResetClaimConditions(
contract,
tokenId,
);
return (
<Web3Button
contractAddress={contractAddress}
action={() => resetClaimConditions()}
>
Reset Claim Conditions
</Web3Button>
);
}