Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte 5 snippets parameter 'x' implicitly has an 'any' type

$
0
0

After upgrading to Svelte 5, I tried the new {#snippet ...}. I am getting this type errors, but in the svelte docs it is like they do not exist for them.

{#snippet NavLink(href, text)}<a class="text-white" {href}>{text}</a>{/snippet}

Parameter href implicitly has an any type.

We can fix this issue provisionally by doing this (but I don't like it):

{#snippet NavLink(/** @type {any} */ href)}<a class="text-white" {href}>hello</a>{/snippet}

Is there a better way?


Viewing all articles
Browse latest Browse all 1541

Trending Articles