Svelte & bind:this #580
-
|
I'm trying to create a reference to the calendar in svelte so I can call methods from other components. However, I'm running into some TypeScript errors. <script lang="ts">
import {Calendar, TimeGrid} from '@event-calendar/core';
let options = $state({
view: 'timeGridWeek',
events: [
// your list of events
]
});
let calendar: Calendar;
</script>
<Calendar bind:this={calendar} plugins={[TimeGrid]} {options} />This works, however, I have the following error in VS Code:
If I try to remove the typing from What is the preferred way to clear this error? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
If anyone needs the solution to this: let calendar: SvelteComponent; |
Beta Was this translation helpful? Give feedback.
If anyone needs the solution to this: