Skip to content

What is the type of a lucide-svelte icon? #1585

Answered by lolcabanon
shyakadavis asked this question in Q&A

You must be logged in to vote

@shyakadavis if I got that right you should be able to do this then (when the type will be exported again in a fix release?) :

import { type ComponentType } from 'svelte';
import { type Icon } from 'lucide-svelte'; 

type TRoute = {
	name: string;
	path: string;
	icon: ComponentType<Icon>;
};

Your issue was probably with how svelte handle component prop types, you have to wrap it in a ComponentType<>.

I'll just let @ericfennis confirm that the Icon type should still be exported.

Replies: 2 comments 13 replies

You must be logged in to vote
1 reply
@shyakadavis

You must be logged in to vote
12 replies
@shyakadavis

@ericfennis

@lolcabanon

@lolcabanon

Answer selected by shyakadavis
@shyakadavis

@AdrianGonz97

@shyakadavis

@GusMartins499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants