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>
);
}

Returns

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