llms.txt
@mysten/sui v2.0 and a new dApp Kit are here! Check out the migration guide
Mysten Labs SDKs
dApp Kit (Legacy)Wallet hooks

useDisconnectWallet

Legacy React mutation hook to disconnect from the currently connected wallet.

The useDisconnectWallet hook is a mutation hook for disconnecting from an active wallet connection, if currently connected.

import { ConnectButton, useDisconnectWallet } from '@mysten/dapp-kit';

function MyComponent() {
	const { mutate: disconnect } = useDisconnectWallet();
	return (
		<div>
			<ConnectButton />

			<button onClick={() => disconnect()}>Disconnect</button>
		</div>
	);
}

Example

Loading...

Arguments

There are no arguments for useDisconnectWallet.

On this page