-
-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lucide-svelte is publishing with SvelteComponentTyped #1797
Comments
As demonstrated in the Svelte PR that introduced the change: sveltejs/svelte#8512 You need to either add <script lang="ts">
import type { SvelteComponent } from 'svelte';
import FilePenLine from 'lucide-svelte/icons/file-pen-line';
const icon: typeof SvelteComponent<any> = FilePenLine;
</script>
<svelte:component this={icon}/> or use the <script lang="ts">
import type { ComponentType } from "svelte";
import type { Icon } from "lucide-svelte";
import FilePenLine from "lucide-svelte/icons/file-pen-line";
const icon: ComponentType<Icon> = FilePenLine;
</script>
<svelte:component this={icon} /> |
Thanks Adrian, it works! I still don't understand why exactly import { SvelteComponent } from "svelte";
// [...]
export type ActivityProps = typeof __propDef.props;
export type ActivityEvents = typeof __propDef.events;
export type ActivitySlots = typeof __propDef.slots;
export default class Activity extends SvelteComponent<ActivityProps, ActivityEvents, ActivitySlots> {
}
export {}; Strange, isn't it? |
Ahh, that might be because your icon library probably defines the
|
That explains it all. Thanks again Adrian! |
Package
Version
0.309.0
Browser
Operating system
Description
Even tho #1517 replaces
SvelteComponentTyped
withSvelteComponent
, version 0.309.0 still shows the followingSvelteComponentTyped
is deprecated. This leads to problems when trying to use generic icons, such as the following:This is happening even for newer icons, such as
list-collapse
Steps to reproduce
Install the latest version of
lucide-svelte
Add the following code to
App.svelte
Checklist
The text was updated successfully, but these errors were encountered: