Skip to main content

Methods Overview

The Calendar component exposes its instance API through ref or the init callback. The API covers state snapshots, action dispatch, event-bus subscription, and provider chaining.

import { useRef } from "react";
import { Calendar } from "@svar-ui/react-calendar";

const apiRef = useRef(null);

<Calendar ref={apiRef} events={[]} date={new Date()} />

Methods

detachRemoves a previously registered handler or interceptor by its tag
execDispatches a store action through interceptors, handlers, and the prop router
getEventReturns a single event by id
getEventsReturns the events stored in the calendar, optionally filtered by date range
getReactiveStateReturns reactive state refs for each state field
getStateReturns a non-reactive snapshot of the calendar store state
getStoresReturns the raw store instances powering the calendar
interceptRegisters a handler that runs before built-in handlers and can cancel the action
onRegisters a handler that runs after an action is dispatched
Methods OverviewMethods exposed by the Calendar component instance via ref or the init callback
setNextAppends a downstream handler at the end of the event bus chain