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

Arguments

There are no arguments for useConnectWallet.