Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/docs/plugins/plugin-calendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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',
Expand Down