Overview
useEvent reads the event loaded by EventProvider from context, returning the event plus bound actions (updateEvent, deleteEvent, cancelEvent, setRsvp, withdrawRsvp). useEventData is the underlying hook the provider uses — call it directly when you want the same managed state without the provider/context.
useEvent
Call inside a descendant ofEventProvider.
useEvent returns a Partial<UseEventDataValues> (empty object outside a provider).
useEventData
Manage an event without the provider. Pass either a pre-fetchedevent or an eventId to fetch.
Parameters
A pre-fetched event. Use this or
eventId.An event ID to fetch. Use this or
event.Associations to expand when fetching by
eventId.Returns (both hooks)
The event.
undefined while loading, null if not found.Set the event state directly (optimistic updates).
Update mutable fields (host-only).
Delete the event (host-only).
Cancel the event (host-only).
Set/change the caller’s RSVP.
Withdraw the caller’s RSVP.

