diff --git a/content/docs/plugins/plugin-calendar.mdx b/content/docs/plugins/plugin-calendar.mdx index 14013b17bd..e0937ed06d 100644 --- a/content/docs/plugins/plugin-calendar.mdx +++ b/content/docs/plugins/plugin-calendar.mdx @@ -518,10 +518,9 @@ const taskCalendar: ObjectCalendarSchema = { You can also import and use the components directly in React: -{/* doc-snippet: fragment — the `ObjectCalendar` half cannot compile as written, because the `schema` literal below omits the required `type: 'object-calendar'` discriminant. The SHIPPED prop type is `ObjectCalendarComponentProps.schema: ObjectCalendarSchema` (`plugin-calendar/dist/ObjectCalendar.d.ts`), whose `type` member is the literal `'object-calendar'`. Compiling this exact block against the built workspace measures TS2741 x1 (Property 'type' is missing) and TS2322 x0. ⚠️ This reason was rewritten by objectui#8651: it previously said the prop was declared a grid/date-picker union and that neither arm admitted an `object-calendar` node, with a measurement of TS2322 x1. Every clause of that reason is false at this head, because objectui#8651 re-pointed the prop at the published element schema — which is also why the objectui#7311 'stale declaration' framing is gone. ⛔ Whether the old TS2322 x1 held when it was written is NOT asserted here: that would need a build of the old tree, which was not done. The fix for the block itself is to add the discriminant, not a cast. */} ```tsx import { CalendarView, ObjectCalendar } from '@object-ui/plugin-calendar'; -import type { DataSource } from '@object-ui/types'; +import type { DataSource, ObjectCalendarSchema } from '@object-ui/types'; // CalendarView - Standalone calendar function MyCalendar() { @@ -546,7 +545,8 @@ function MyCalendar() { // ObjectCalendar - ObjectQL-integrated function MyObjectCalendar({ dataSource }: { dataSource: DataSource }) { - const schema = { + const schema: ObjectCalendarSchema = { + type: 'object-calendar', objectName: 'events', calendar: { startDateField: 'startDate',