I'm asking for a suggest on how to type correctly the schema for how an EventObject should be, including what's inside the "extendedProps" key.
As of now I've done it like this:
interface ICustomExtendedProps {
privateNote?: string;
publicNote?: string;
owner: { id: number; name: string };
guest: { id: number; name: string };
status: EventStatus;
}
export interface CustomEventInput extends EventInput {
extendedProps?: ICustomExtendedProps;
}
Then I created some mock data using this schema and passed them directly inside the key in the fullcalendar component.
The thing is that I'm creating various kind of custom views using selfmade eventContent components. But now inside the eventContent callback I get the event as a object, which loses all the custom types I declared before.
Probably this is really a beginner question, but how am I supposed to have consistency in the types?
edit: I'm adding the cb snippet
<FullCalendar
views={{
dayGridMonth: {
eventContent: ({ event }) => (
<DayGridMonthCustomView
eventData={event}
onClickHandler={eventClickHandler.bind(null, event)}
/>
)
},
}}
/>
The argument I get from the callback is of the type , I'm not losing the data inside the event, I'm losing only the type since fullcalendar doesn't know the shape of the event.
