fullcalendar / fullcalendar-react

The official React Component for FullCalendar
https://fullcalendar.io/docs/react
MIT License
2.09k stars 110 forks source link

ResourceTimelinePlugin React Typescript Error #171

Closed lcundiff closed 2 years ago

lcundiff commented 2 years ago

I have reproduced the bug here https://codesandbox.io/s/full-calendar-react-render-event-forked-lco5o?file=/src/Schedule.tsx

The issue seems to be that the resourceTimeline plugin type is not assignable to the plugin type that FullCalendar React is expecting. Here is the type error I receive:

Overload 2 of 2, '(props: CalendarOptions, context?: any): FullCalendar', gave the following error. Type 'import("@fullcalendar/core/plugin-system").PluginDef' is not assignable to type 'import("/client/node_modules/@fullcalendar/common/main").PluginDef'.

If there is something I am doing wrong, please let me know. We are currently paying for FullCalendar premium as well and have a schedulerLicenseKey. (Also I tried setting the plugin to any type, but then the FullCalendar will say that there is no "resourceAreaWidth" on the FullCalendar type.)

acerix commented 2 years ago

I think the error comes from the versions you are using, eg. v4 plugins are not compatible with v5. Here's an example in the React debug template with that view:

https://codesandbox.io/s/competent-sid-5022n?file=/src/DemoApp.jsx