Changelog
All notable changes to the CalendarJS React components and the @calendarjs/react package.
@calendarjs/react v1.0.1
Section titled “@calendarjs/react v1.0.1”-
Hooks —
useCalendar,useSchedule,useTimelinereturn a callback ref plus a reactiveinstance(nullbefore mount, the lemonadejs instance after). Drop-in alternative to manualuseReffor state-driven toolbars and conditional rendering. Hooks reference → -
data-*/aria-*/rolepassthrough on the wrapper<div>for Playwright, React Testing Library, and screen readers.<Schedule data-testid="weekly-schedule" aria-label="Class timetable" data={events} /> -
Input vs resolved type split — new
Schedule.EventInputandTimeline.ItemInputtypes accept loose input (onlystart/daterequired) and include an index signature for app metadata. The strictSchedule.Event/Timeline.Itemare what callbacks andgetData()hand back. No moreas anyto attachclass_id,teacher_id, etc. TypeScript guide →const events: Schedule.EventInput[] = [ { start: '09:00', end: '10:00', class_id: 42, teacher_id: 7 }, ]; const onCreate = (created: Schedule.Event[]) => { /* strict shape */ };
Changed
Section titled “Changed”onCreate/onBeforeCreatealways receive an array (Event[], length ≥ 1). The legacyEvent | Event[]union has been dropped. Existing handlers usingArray.isArray(events) ? events : [events]can drop the unwrap.addEvents,setData,updateEvent.newValuenow accept the looseEventInputshape (orPartial<EventInput>fornewValue).getData()still returns the resolvedEvent[].- Type namespaces re-exported through
@calendarjs/react—import type { Schedule as ScheduleNS } from '@calendarjs/react'now resolvesScheduleNS.Event,ScheduleNS.EventInput,ScheduleNS.Options,ScheduleNS.Instancedirectly. Same forTimelineandCalendarnamespaces.
Documentation
Section titled “Documentation”- New Hooks page —
useCalendar/useSchedule/useTimelinereference and composition patterns. - New TypeScript page — input vs resolved types, typed refs, app metadata.
- Getting Started expanded with controlled-vs-imperative guidance, reference identity, and
useCallbackmemoization notes.
@calendarjs/react v1.0.0
Section titled “@calendarjs/react v1.0.0”- Single-package install for all three React components:
Calendar,Schedule,Timeline - Idiomatic React API:
- camelCase callback props —
onChange,onCreate,onUpdate,onClose,onOpen,onChangeEvent,onBeforeChange,onBeforeCreate,onBeforeChangeEvent,onBeforeInsert,onDelete,onError,onEdition,onDblClick selfstripped from callback signatures — user handlers receive just the relevant arguments; the instance is available via the forwarded ref- Controlled-component support — pass
value+onChangeand the parent becomes the source of truth React.memowrapping — skips effect reruns when props haven't changeduseImperativeHandle— exposes the instance through the forwarded ref idiomaticallyclassName/style/childrenpassthrough on the wrapping<div>- Stale-closure protection — callback props always invoke the latest handler (no frozen closures on parent rerenders)
- camelCase callback props —
Helpersre-exported from the aggregate package- TypeScript types for all React-idiomatic prop shapes
Breaking changes (vs individual @lemonadejs/<plugin>/dist/react wrappers)
Section titled “Breaking changes (vs individual @lemonadejs/<plugin>/dist/react wrappers)”- Calendar: the legacy
onChangeprop (capital C) — previously wired to the bound input element's native DOMchangeevent — is renamed toonInputChange.onChangeis now the date-selection callback, matching React convention. Migration: renameonChange→onInputChangefor the DOM input handler.
v1.0.6 - 2025-12-31
Section titled “v1.0.6 - 2025-12-31”- Timeline item
editableproperty and componentonEditionevent
v1.0.1 - 2025-12-15
Section titled “v1.0.1 - 2025-12-15”- Calendar component with date / range / time selection
- Schedule component with day / week / weekdays views
- Timeline component for chronological events
- Date helpers library
- TypeScript definitions
- React / Vue / Angular support
- Initial release fixes