# useLogout | @account-kit/react

> Overview of the useLogout hook from @account-kit/react

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function useLogout(mutationArgs?): UseLogoutResult;
```

Defined in: [account-kit/react/src/hooks/useLogout.ts:38](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useLogout.ts#L38)

Provides a [hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useLogout.ts) to log out a user, disconnecting the signer and triggering the disconnectAsync function.
This will disconnect both EVM and Solana wallets.

## Example

```ts twoslash
import { useLogout } from "@account-kit/react";

const { logout, isLoggingOut, error } = useLogout({
  // these are optional
  onSuccess: () => {
    // do something on success
  },
  onError: (error) => console.error(error),
});
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `mutationArgs?`
      </td>

      <td>
        `Partial`\<`Omit`\<`UseMutationOptions`\<`void`, `Error`, `void`, `unknown`>, `"mutationFn"` | `"mutationKey"`>>
      </td>

      <td>
        optional arguments to customize the mutation behavior
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`UseLogoutResult`](../type-aliases/UseLogoutResult)

an object containing the logout function, a boolean indicating if logout is in progress, and any error encountered during logout