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

# useWeb3AuthDisconnect

Hook to disconnect the current user session.

### Import[​](#import "Direct link to Import")

```
import { useWeb3AuthDisconnect } from '@web3auth/react-native-sdk'

```

### Usage[​](#usage "Direct link to Usage")

```
import { useWeb3AuthDisconnect } from '@web3auth/react-native-sdk'

function LogoutButton() {
  const { disconnect, loading, error } = useWeb3AuthDisconnect()

  return (
    <View>
      <Button
        title={loading ? 'Signing out…' : 'Sign out'}
        disabled={loading}
        onPress={() => disconnect()}
      />
      {error && <Text>{error.message}</Text>}
    </View>
  )
}

```

### Return type[​](#return-type "Direct link to Return type")

#### `disconnect`[​](#disconnect "Direct link to disconnect")

`() => Promise<void>`

Terminates the current authenticated session and clears the stored session data from the device. After this resolves, `useWeb3Auth().isConnected` becomes `false`.

#### `loading`[​](#loading "Direct link to loading")

`boolean`

`true` while the disconnect operation is in progress.

#### `error`[​](#error "Direct link to error")

`Web3AuthError | null`

Error from the most recent `disconnect` call, or `null` if no error occurred.
