useListing
Hook for getting a specific listing on a Marketplace contract.
Marketplace V3
Note: this hook is only available for Marketplace contracts.
If you are using Marketplace V3, use useDirectListing or useEnglishAuction instead.
import { useListing } from "@thirdweb-dev/react";
const { data, isLoading, error } = useListing(contract, "{{listing_id}}");
Usage
Provide your marketplace contract and the listing ID you wish to check as the arguments.
import { useContract, useListing } from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const listingId = 0;
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data, isLoading, error } = useListing(contract, listingId);
}