dApp Kit
Wallet Hooks
useDisconnectWallet

useDisconnectWallet

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

Arguments

There are no arguments for useConnectWallet.