Skip to main content

Overview

useDeleteEvent returns a callable that deletes an event. Host-only. The event’s RSVPs and invites are cleaned up; whether the event is soft- or hard-deleted (and whether its files are preserved) follows the project’s eventDeletion settings.

Usage Example

import { useDeleteEvent } from "@sublay/react-js";

function DeleteButton({ eventId }: { eventId: string }) {
  const deleteEvent = useDeleteEvent();
  return <button onClick={() => deleteEvent({ eventId })}>Delete</button>;
}

Parameters

eventId
string
required
The event to delete.

Returns

Returns a Promise<void>.

See Also