Skip to main content

Overview

useSetRsvp returns a callable that sets or changes the logged-in user’s RSVP. The event’s rsvpCounts update atomically. A transition into going is capacity-checked. RSVPs close at startTime, are rejected on cancelled events, and "maybe" is rejected when allowMaybe is false.

Usage Example

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

function GoingButton({ eventId }: { eventId: string }) {
  const setRsvp = useSetRsvp();
  return <button onClick={() => setRsvp({ eventId, status: "going" })}>Going</button>;
}

Parameters

eventId
string
required
The event ID.
status
"going" | "maybe" | "not_going"
required
The RSVP response.

Returns

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

See Also