Skip to main content

Overview

useWithdrawRsvp returns a callable that removes the logged-in user’s RSVP. The RSVP row is deleted and the matching count decremented. It is idempotent — withdrawing with no RSVP succeeds and changes nothing.

Usage Example

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

function WithdrawButton({ eventId }: { eventId: string }) {
  const withdrawRsvp = useWithdrawRsvp();
  return <button onClick={() => withdrawRsvp({ eventId })}>Withdraw RSVP</button>;
}

Parameters

eventId
string
required
The event ID.

Returns

Returns a Promise<Event> — the Event with refreshed rsvpCounts.

See Also