hooks/useDisconnect
Hook
useDisconnect()
useDisconnect():
AsyncMutationState
\<() =>Promise
\<boolean
>,"disconnect"
>
A hook that returns a function that disconnects the ComPilot SDK.
Returns
AsyncMutationState
\<() => Promise
\<boolean
>, "disconnect"
>
The async mutation state of the disconnect function.
Example
import { useDisconnect } from "@compilot/react-sdk";
const Logout = () => {
const { disconnect, isLoading } = useDisconnect();
return (
<button
disabled={isLoading}
onClick={disconnect}
>
Logout
</button>;
);
};