useLogout

Hook for signing out of a wallet after a user has logged in using useLogin

Example

import { useLogout } from "@thirdweb-dev/react";
function App() {
const { logout, isLoading } = useLogout();
return (
<button onClick={() => logout()}>
{isLoading ? "Logging out..." : "Logout"}
</button>
);
}
function useLogout(): {
isLoading: boolean;
logout: UseMutateAsyncFunction<void, unknown, void, unknown>;
};

Returns

let returnType: {
isLoading: boolean;
logout: UseMutateAsyncFunction<void, unknown, void, unknown>;
};

object containing a logout function and an isLoading state that indicates if the logout request is in progress