useActiveAccount

A hook that returns the active account

Example

import { useActiveAccount } from "thirdweb/react";
const activeAccount = useActiveAccount();
console.log("address", activeAccount?.address);
function useActiveAccount(): undefined | Account;

Returns

let returnType: undefined | Account;

The active Account or undefined if no active account is set.