Skip to main content

useEdition() function

Warning: This API is now obsolete.

This hook is deprecated and will be removed in a future major version. You should use instead.

- const edition = useEdition("0x1234...");
+ const edition = useContract("0x1234...", "edition").contract;

Hook for getting an instance of an Edition contract. This contract is used to interface with ERC1155 compliant NFTs.

Example

import { useContract } from '@thirdweb-dev/react'

export default function Component() {
const { contract } = useContract("<YOUR-CONTRACT-ADDRESS>", "edition")

// Now you can use the edition contract in the rest of the component

// For example, this function will return all the NFTs on this contract
async function getNFTs() {
const nfts = await contract.getAll()
return nfts
}

...
}

Signature:

export declare function useEdition(
contractAddress: RequiredParam<string>,
): import("@thirdweb-dev/sdk").Edition | undefined;

Parameters

ParameterTypeDescription
contractAddressRequiredParam<string>the address of the Edition contract, found in your thirdweb dashboard

Returns:

import("@thirdweb-dev/sdk").Edition | undefined