ThirdwebProvider

The ThirdwebProvider is component is a provider component that sets up the React Query client.

Example

import { ThirdwebProvider } from "thirdweb/react";
function Example() {
return (
<ThirdwebProvider>
<App />
</ThirdwebProvider>
);
}
function ThirdwebProvider(
props: PropsWithChildren<{
connectionManager?: {
activeAccountStore: Store<undefined | Account>;
activeWalletChainStore: Store<
undefined | Readonly<ChainOptions & { rpc: string }>
>;
activeWalletConnectionStatusStore: Store<ConnectionStatus>;
activeWalletStore: Store<undefined | Wallet>;
addConnectedWallet: (wallet: Wallet) => void;
connect: (
wallet: Wallet,
) => Promise<Wallet>;
connectedWallets: ReadonlyStore<Array<Wallet>>;
defineChains: (
chains: Array<Readonly<ChainOptions & { rpc: string }>>,
) => void;
disconnectWallet: (wallet: Wallet) => void;
handleConnection: (
wallet: Wallet,
) => Promise<Wallet>;
isAutoConnecting: Store<boolean>;
removeConnectedWallet: (wallet: Wallet) => void;
setActiveWallet: (activeWallet: Wallet) => Promise<void>;
switchActiveWalletChain: (
chain: Readonly<ChainOptions & { rpc: string }>,
) => Promise<void>;
};
}>,
): Element;

Parameters

The props for the ThirdwebProvider

Type

let props: PropsWithChildren<{
connectionManager?: {
activeAccountStore: Store<undefined | Account>;
activeWalletChainStore: Store<
undefined | Readonly<ChainOptions & { rpc: string }>
>;
activeWalletConnectionStatusStore: Store<ConnectionStatus>;
activeWalletStore: Store<undefined | Wallet>;
addConnectedWallet: (wallet: Wallet) => void;
connect: (
wallet: Wallet,
) => Promise<Wallet>;
connectedWallets: ReadonlyStore<Array<Wallet>>;
defineChains: (
chains: Array<Readonly<ChainOptions & { rpc: string }>>,
) => void;
disconnectWallet: (wallet: Wallet) => void;
handleConnection: (
wallet: Wallet,
) => Promise<Wallet>;
isAutoConnecting: Store<boolean>;
removeConnectedWallet: (wallet: Wallet) => void;
setActiveWallet: (activeWallet: Wallet) => Promise<void>;
switchActiveWalletChain: (
chain: Readonly<ChainOptions & { rpc: string }>,
) => Promise<void>;
};
}>;

Returns

let returnType: Element;