GitHub

Source

useDisconnectButton

The useDisconnectButton hook is used to implement the DisconnectButton or your custom implementation of it. It adds onClick handler to the button to disconnect from the room.

Import

import { useDisconnectButton } from "@livekit/components-react";

Usage

const { buttonProps } = useDisconnectButton(buttonProps);
return <button {...buttonProps}>Disconnect</button>;

Properties

stopTracks?boolean

Returns

{
buttonProps: DisconnectButtonProps & {
className: string;
onClick: () => void;
disabled: boolean;
};
}