worthy-azureW
Refine•4y ago•
10 replies
worthy-azure

Reg. SvelteKit CRUD Blog Post - Accessing Component Param from +page.svelte

Hi:
Love the SvelteKit post -- Building a CRUD App with SvelteKit.
Thank you. 🙂

Now, as I am coding along, I am having an issue when accessing the 'open' component param for Dialog.svelte, from +page.svelte, with the shared code.

While the TS Server throws up the error that 'open' cannot be assigned since it is a function (ts:2630), when passing it into the <Button /> on:click event arrow function; further below, while initialising the <Dialog /> component itself, with the '<Dialog {open} />' line, while it is rightly identified as a boolean prop out here, it seems to be identified as undefined (ts:2322) by the editor/language-server.

What gives? What could I do to get around this?
Kindly advise.

BR/ Paresh
Was this page helpful?