getEvent
Looks up an event in the calendar store by its id. Returns undefined when no event matches.
Usage
getEvent(id: string | number): CalendarEvent | undefined;
| Parameter | Type | Description |
|---|---|---|
id | string | number | Event id to look up |
Example
import { useRef } from "react";
import { Calendar } from "@wx/react-calendar";
function App() {
const apiRef = useRef(null);
function logEvent() {
const event = apiRef.current.getEvent(42);
console.log(event);
}
return <Calendar ref={apiRef} events={events} />;
}