NFT

A React context provider component that supplies NFT-related data to its child components.

This component serves as a wrapper around the NFTProviderContext.Provider and passes the provided NFT data down to all of its child components through the context API.

Example

import { getContract } from "thirdweb";
import { NFT } from "thirdweb/react";
const contract = getContract({
address: "0x...",
chain: ethereum,
client: yourThirdwebClient,
});
<NFT contract={contract} tokenId={0n}>
<Suspense fallback={"Loading media..."}>
<NFT.Media />
<NFT.Description />
</Suspense>
</NFT>;
function NFT(props: PropsWithChildren<NFTProviderProps>): Element;

Parameters

The props for the NFT provider

Type

let props: PropsWithChildren<NFTProviderProps>;

Returns

let returnType: Element;