useCreateWalletInstance

Hook for creating a wallet instance from given WalletConfig object.

If you just want to connect the wallet and don't need the wallet instance before connecting the wallet, use the useConnect hook instead.

Example

import { useConnect, metamaskWallet } from "@thirdweb-dev/react";
const metamaskConfig = metamaskWallet();
function App() {
const createWalletInstance = useCreateWalletInstance();
return (
<button
onClick={() => {
const metamaskWalletInstance =
createWalletInstance(metamaskConfig);
console.log(metamaskWalletInstance);
}}
>
create wallet instance
</button>
);
}
function useCreateWalletInstance(): (Wallet: WalletConfig<I>) => I;

Returns

let returnType: (Wallet: WalletConfig<I>) => I;

A function that creates a wallet instance for given WalletConfig object.