Skip to main content

useAddress

Hook for getting the currently connected wallet address.

Returns undefined if no wallet is connected.

import { useAddress } from "@thirdweb-dev/react";

Usage

Call the hook to get the current wallet address.

import { useAddress } from "@thirdweb-dev/react";

function App() {
const address = useAddress();

if (!address) return <div>No wallet connected</div>;

return <div>My wallet address is {address}</div>;
}

Return value

string | undefined;
  • Returns a string containing the wallet address.
  • Returns undefined if no wallet is connected.