A hook that returns the active wallet
import { useActiveWallet } from "thirdweb/react"; const wallet = useActiveWallet();
const wallet = useActiveWallet(); wallet?.subscribe("accountChanged", (account) => { console.log(account);});
const wallet = useActiveWallet(); wallet?.subscribe("accountsChanged", (addresses) => { console.log(addresses);});
const wallet = useActiveWallet(); wallet?.subscribe("chainChanged", (chain) => { console.log(chain);});
function useActiveWallet(): undefined | Wallet;
let returnType: undefined | Wallet;
The active Wallet or undefined if no active wallet is set.
Wallet
undefined