dApp Kit
Wallet Hooks
useDisconnectWallet

useConnectWallet

The useConnectWallet 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