NFTProvider

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 {
NFTProvider,
NFTMedia,
NFTDescription,
NFTName,
} from "thirdweb/react";
const contract = getContract({
address: "0x...",
chain: ethereum,
client: yourThirdwebClient,
});
<NFTProvider contract={contract} tokenId={0n}>
<NFTMedia />
<NFTDescription />
<NFTName />
</NFTProvider>;
function NFTProvider(
props: PropsWithChildren<NFTProviderProps>,
): Element;

Parameters

The props for the NFT provider

Type

let props: PropsWithChildren<NFTProviderProps>;

Returns

let returnType: Element;